From 1b5a15ebb78badf9436aa31279de7088a892e6ad Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Thu, 13 Jun 2024 07:54:32 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=95MQTT=20device=5Ftracker=20state=20f?= =?UTF-8?q?ix=20attempt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/plugins/_publisher_mqtt/mqtt.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/front/plugins/_publisher_mqtt/mqtt.py b/front/plugins/_publisher_mqtt/mqtt.py index 506a8cae..8f54efe3 100755 --- a/front/plugins/_publisher_mqtt/mqtt.py +++ b/front/plugins/_publisher_mqtt/mqtt.py @@ -123,12 +123,15 @@ class sensor_config: self.json_attr_topic = f'system-sensors/device_tracker/{self.deviceId}/attributes' self.unique_id = f'{self.deviceId}_{self.sensorType}_{self.sensorName}' + payload_home = 'home' + payload_away = 'away' + self.message = { "state_topic": self.state_topic, "json_attributes_topic": self.json_attr_topic, "name": self.sensorName, - "payload_home": "home", - "payload_not_home": "away", + "payload_home": payload_home, + "payload_not_home": payload_away, "unique_id" : self.unique_id, "icon": f'mdi:{self.icon}', "device":