implement door status synchronization towards club-assistant
All checks were successful
Build Container / Build Container (push) Successful in 4m22s

This commit is contained in:
lilly 2026-11-06 15:18:03 +01:00
commit 3f08745544
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g

View file

@ -143,7 +143,9 @@ class AsyncMqttClient:
if to_remove:
self.active_subscriptions.difference_update(to_remove)
if self.is_connected:
logger.info(f"mqtt client unsubscribing from topics {','.join(to_remove)}")
logger.info(
f"mqtt client unsubscribing from topics {','.join(to_remove)}"
)
self.fut_unsubscribe = asyncio.get_running_loop().create_future()
self.client.unsubscribe(list(to_remove))
await self.fut_unsubscribe
@ -170,7 +172,7 @@ class AsyncMqttClient:
async def disconnect(self):
if not self.is_connected:
return
logger.info("Disconnecting mqtt client from broker")
self.fut_disconnect = asyncio.get_running_loop().create_future()
self.client.disconnect()
@ -179,3 +181,7 @@ class AsyncMqttClient:
@property
def is_connected(self) -> bool:
return self.client.is_connected()
async def publish(self, topic: str, msg: bytes, qos: int):
logger.debug(f"Publishing mqtt message on topic {topic}: {msg}")
self.client.publish(topic, msg, qos)