Move mqtt bridge state.

This commit is contained in:
Koen Kanters 2018-04-15 21:23:49 +02:00
parent fa61d17f0b
commit 8d9911b4b5

View File

@ -181,6 +181,8 @@ function handleMessage(msg) {
} }
function handleQuit() { function handleQuit() {
mqttPublish(`${settings.mqtt.base_topic}/bridge/state`, 'offline', true);
shepherd.stop((err) => { shepherd.stop((err) => {
if (err) { if (err) {
logger.error('Error while stopping zigbee-shepherd'); logger.error('Error while stopping zigbee-shepherd');
@ -188,7 +190,6 @@ function handleQuit() {
logger.error('zigbee-shepherd stopped') logger.error('zigbee-shepherd stopped')
} }
mqttPublish(`${settings.mqtt.base_topic}/bridge/state`, 'offline', true);
process.exit(); process.exit();
}); });
} }