Publish availability of devices
This commit is contained in:
parent
61d16fc07c
commit
f3b8181107
2 changed files with 22 additions and 0 deletions
|
|
@ -27,6 +27,12 @@ async function main() {
|
|||
);
|
||||
const client = new MqttClient(config.mqttBroker, config.mqttUsername, config.mqttPassword);
|
||||
|
||||
['SIGINT', 'SIGHUP', 'SIGTERM'].forEach(signal => {
|
||||
process.on(signal, () => {
|
||||
client.disconnect(() => process.exit(0));
|
||||
});
|
||||
});
|
||||
|
||||
plejdApi.login().then(() => {
|
||||
// load all sites and find the one that we want (from config)
|
||||
plejdApi.getSites().then((site) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue