From 42f7875f26c74220f8b19dcf5e9e6bf8837ae1ff Mon Sep 17 00:00:00 2001 From: Michael Woods Date: Fri, 11 Jun 2021 10:57:34 -0400 Subject: [PATCH] Fix availability bug. --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index 26120a7..ebc429b 100644 --- a/src/index.js +++ b/src/index.js @@ -84,6 +84,8 @@ const configureMQTT = async (commands, client, mqttHA) => { const mqttHA = new MQTT(vehicles[0], 'homeassistant'); const availTopic = mqttHA.getAvailabilityTopic(); const client = await connectMQTT(availTopic); + client.publish(availTopic, 'true', {retain: true}) + .then(() => logger.debug('Published availability')); await configureMQTT(commands, client, mqttHA); const configurations = new Map();