Skip to content

Commit

Permalink
Move mqtt bridge state.
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Apr 15, 2018
1 parent fa61d17 commit 8d9911b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,15 @@ function handleMessage(msg) {
}

function handleQuit() {
mqttPublish(`${settings.mqtt.base_topic}/bridge/state`, 'offline', true);

shepherd.stop((err) => {
if (err) {
logger.error('Error while stopping zigbee-shepherd');
} else {
logger.error('zigbee-shepherd stopped')
}

mqttPublish(`${settings.mqtt.base_topic}/bridge/state`, 'offline', true);
process.exit();
});
}
Expand Down

0 comments on commit 8d9911b

Please sign in to comment.