Skip to content

Commit 2a162e0

Browse files
committed
Improve logging of discovered devices prior to launching.
1 parent f9fc452 commit 2a162e0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ function SMAHomeManager(log, config, api) {
210210
setInterval(function() {
211211
this._readInverterMetadata();
212212
if (this.accessoriesCallback) {
213+
this.log.info('Discovered SMA inverter:', this.discovered.inverter ? this.discovered.inverter : 'no');
214+
this.log.info('Discovered SMA energy manager:', this.discovered.energyManager ? this.discovered.energyManager : 'no');
213215
if (this.discovered.inverter && this.discovered.energyManager) {
214216
// Prevent race condition: store the callback locally and overwrite it.
215217
const callback = this.accessoriesCallback;
216218
this.accessoriesCallback = false;
217219

218-
this.log.debug('Discovered', this.discovered);
219-
220220
// Expose serial numbers & firmware revisions.
221221
this._setAccessoryInformation(this.live);
222222
this._setAccessoryInformation(this.recent);
@@ -231,10 +231,6 @@ function SMAHomeManager(log, config, api) {
231231
])
232232
this.launched = true;
233233
}
234-
else {
235-
this.log.info('Discovered SMA inverter:', this.discovered.inverter ? this.discovered.inverter : 'no');
236-
this.log.info('Discovered SMA energy manager:', this.discovered.energyManager ? this.discovered.energyManager : 'no');
237-
}
238234
}
239235
}.bind(this), 1000);
240236
}

0 commit comments

Comments
 (0)