From 3f36bab253c2d7f9f74dbff5e84bc7352058f2b6 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Thu, 24 Apr 2025 16:28:26 +0200 Subject: [PATCH] Fix bug when on_connect happens twice --- hasspy/mqtt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hasspy/mqtt.py b/hasspy/mqtt.py index 8cc9057..d973cb9 100644 --- a/hasspy/mqtt.py +++ b/hasspy/mqtt.py @@ -105,7 +105,8 @@ class HassClient(Client): self.publish_availability() self.init_subs() - self.timer.start() + if self.timer.ident is None: + self.timer.start() @property def state_topic(self) -> str: