Extend exception messages for warning logs

This commit is contained in:
Philipp Grathwohl 2021-12-03 11:56:28 +01:00
parent f337cb8e97
commit 7413f79d6e

View file

@ -33,24 +33,24 @@ class SatelliteController:
if self.client is not None and self.client._connected: if self.client is not None and self.client._connected:
try: try:
await self.client.publish(topic, message, qos=1, retain=retain) await self.client.publish(topic, message, qos=1, retain=retain)
except: except Exception as e:
self.logger.warning("Failed to push data via mqtt") self.logger.warning("Failed to push data via mqtt: {}".format(e))
async def _actor_on(self, messages): async def _actor_on(self, messages):
async for message in messages: async for message in messages:
try: try:
topic_key = message.topic.split("/") topic_key = message.topic.split("/")
await self.cbpi.actor.on(topic_key[2]) await self.cbpi.actor.on(topic_key[2])
except: except Exception as e:
self.logger.warning("Failed to process actor on via mqtt") self.logger.warning("Failed to process actor on via mqtt: {}".format(e))
async def _actor_off(self, messages): async def _actor_off(self, messages):
async for message in messages: async for message in messages:
try: try:
topic_key = message.topic.split("/") topic_key = message.topic.split("/")
await self.cbpi.actor.off(topic_key[2]) await self.cbpi.actor.off(topic_key[2])
except: except Exception as e:
self.logger.warning("Failed to process actor off via mqtt") self.logger.warning("Failed to process actor off via mqtt: {}".format(e))
async def _actor_power(self, messages): async def _actor_power(self, messages):
async for message in messages: async for message in messages: