Skip to content

Commit e98cff4

Browse files
committed
Remove the validation logic: make all config optional.
1 parent f8d497e commit e98cff4

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

index.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ module.exports = function(homebridge) {
4141
};
4242

4343
function SMAHomeManager(log, config, api) {
44-
// Validate configuration, since `homebridge-config-ui-x` is optional.
45-
if (!Object.keys(config).includes('signals')) {
46-
log.warn(`Invalid configuration: signals key is missing. See config.schema.json.`);
47-
return;
48-
}
49-
if (!Object.keys(config).includes('surplusSignals')) {
50-
log.warn(`Invalid configuration: surplusSignals key is missing. See config.schema.json.`);
51-
return;
52-
}
53-
5444
this.log = log;
5545

5646
// Platform state.
@@ -110,7 +100,7 @@ function SMAHomeManager(log, config, api) {
110100

111101
// Functionality on top of both the inverter & energy manager.
112102
this.signalsConfig = {
113-
builtIn: config.signals,
103+
builtIn: config.signals || [],
114104
surplus: config.surplusSignals || [],
115105
};
116106
// For small variations, like lights etc, which should be excluded from the PV surplus.

0 commit comments

Comments
 (0)