Minor fixes
This commit is contained in:
parent
6276a51f05
commit
42b5576be5
@ -6,14 +6,18 @@
|
||||
"topics": {
|
||||
"igniter": "hestia/status/igniter",
|
||||
"exhaust": "hestia/status/exhaust",
|
||||
"auger": "hestia/status/auger"
|
||||
"auger": "hestia/status/auger",
|
||||
"pof": "hestia/status/pof",
|
||||
"vacuum": "hestia/status/vacuum"
|
||||
}
|
||||
},
|
||||
"states": {
|
||||
"elements": [
|
||||
"igniter",
|
||||
"exhaust",
|
||||
"auger"
|
||||
"auger",
|
||||
"pof",
|
||||
"vacuum"
|
||||
]
|
||||
},
|
||||
"pins": [
|
||||
|
@ -29,6 +29,13 @@ module.exports = {
|
||||
stateChanges.push(`Set ${pin.key} pin to ${pin.defaultState}.`);
|
||||
state[pin.key].power(communicator, pin.defaultState);
|
||||
}).catch(e => console.error(e));
|
||||
} else if (pin.mode === 'IN') {
|
||||
return gpio.readPin(pin.board).then(pinState => {
|
||||
const boolState = pinState === '1' ? true : false;
|
||||
state[pin.key].on = boolState;
|
||||
communicator.send(config.mqtt.topics[pin.key], JSON.stringify(state[pin.key]));
|
||||
stateChanges.push(`${pin.key}: ${state}`);
|
||||
}).catch(e => console.error(e));
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user