S allius/issue125 (#127)

* fix linter warning

* move sequence diagramm to wiki

* catch asyncio.CancelledError
This commit is contained in:
Stefan Allius
2024-07-15 21:45:45 +02:00
committed by GitHub
parent 92a5fd22b8
commit 6f35c47254
4 changed files with 3 additions and 29 deletions

View File

@@ -38,7 +38,8 @@ class Mqtt(metaclass=Singleton):
self.task.cancel()
try:
await self.task
except Exception as e:
except (asyncio.CancelledError, Exception) as e:
logging.debug(f"Mqtt.close: exception: {e} ...")
async def publish(self, topic: str, payload: str | bytes | bytearray