Minor fixes
This commit is contained in:
parent
6276a51f05
commit
42b5576be5
@ -6,14 +6,18 @@
|
|||||||
"topics": {
|
"topics": {
|
||||||
"igniter": "hestia/status/igniter",
|
"igniter": "hestia/status/igniter",
|
||||||
"exhaust": "hestia/status/exhaust",
|
"exhaust": "hestia/status/exhaust",
|
||||||
"auger": "hestia/status/auger"
|
"auger": "hestia/status/auger",
|
||||||
|
"pof": "hestia/status/pof",
|
||||||
|
"vacuum": "hestia/status/vacuum"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"states": {
|
"states": {
|
||||||
"elements": [
|
"elements": [
|
||||||
"igniter",
|
"igniter",
|
||||||
"exhaust",
|
"exhaust",
|
||||||
"auger"
|
"auger",
|
||||||
|
"pof",
|
||||||
|
"vacuum"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pins": [
|
"pins": [
|
||||||
|
@ -29,6 +29,13 @@ module.exports = {
|
|||||||
stateChanges.push(`Set ${pin.key} pin to ${pin.defaultState}.`);
|
stateChanges.push(`Set ${pin.key} pin to ${pin.defaultState}.`);
|
||||||
state[pin.key].power(communicator, pin.defaultState);
|
state[pin.key].power(communicator, pin.defaultState);
|
||||||
}).catch(e => console.error(e));
|
}).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