Skip to content

Commit

Permalink
fix(mqtt): add condition in case payload is not in the MQTT data event
Browse files Browse the repository at this point in the history
related to #82
  • Loading branch information
xaviml committed Jun 7, 2020
1 parent 2e5b9cf commit f9f42f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/controllerx/core/integration/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ def listen_changes(self, controller_id: str) -> None:
)

async def event_callback(self, event_name: str, data: dict, kwargs: dict) -> None:
await self.controller.handle_action(data["payload"])
self.controller.log(f"MQTT data event: {data}", level="DEBUG")
if "payload" in data:
await self.controller.handle_action(data["payload"])

0 comments on commit f9f42f2

Please sign in to comment.