Skip to content

Commit

Permalink
Fix empty dev_list for matter devices
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 2, 2024
1 parent 1a72a29 commit a306c7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/xiaomi_gateway3/core/gate/matter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ def matter_on_mqtt_publish(self, msg: MQTTMessage):
data = decode(msg.payload)
self.matter_process_properties(data["result"][0]["RPC"]["params"])
elif msg.topic == "local/ot/rpcReq":
# {"method":"_sync.matter_dev_status","params":{"dev_list":null}}
if b'"_sync.matter_dev_status"' in msg.payload:
data = decode(msg.payload)
self.matter_process_dev_status(data["params"]["dev_list"])
if dev_list := data["params"].get("dev_list"):
self.matter_process_dev_status(dev_list)

def matter_process_properties(self, params: list[dict]):
devices: dict[str, list] = {}
Expand Down

0 comments on commit a306c7f

Please sign in to comment.