Skip to content

Commit

Permalink
refresh data on event received
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilp committed Jun 5, 2024
1 parent b8e66ce commit ea55e05
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/deltadore_tydom/tydom/MessageHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ async def parse_response(self, incoming, uri_origin, http_request_line):
msg_type = "msg_scenarios"
elif "/devices/install" in http_request_line:
msg_type = "msg_pairing"
elif "/events" in http_request_line:
msg_type = "msg_event"
elif "/ping" in uri_origin:
msg_type = "msg_ping"
elif data != "" and "cdata" in data:
Expand Down Expand Up @@ -185,6 +187,10 @@ async def parse_response(self, incoming, uri_origin, http_request_line):
parsed = json.loads(data)
return await self.parse_devices_metadata(parsed=parsed)

elif msg_type == "msg_event":
LOGGER.debug("Event message, refreshing...")
await self.tydom_client.get_devices_data()

elif msg_type == "msg_html":
LOGGER.debug("HTML Response ?")

Expand Down

0 comments on commit ea55e05

Please sign in to comment.