Skip to content

Commit

Permalink
Fix parsing lumi format from Zigbee 3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Mar 24, 2024
1 parent 77ae1f9 commit 4cbcb19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/xiaomi_gateway3/core/gate/lumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ def lumi_process_lumi(self, data: dict):
items = data.get("params") or data.get("mi_spec")
elif cmd == "read_rsp":
# {"cmd":"read_rsp","did":"lumi","results":[{"res_name":"8.0.2022","value":68,"error_code":0}]}
items = data.get("results")
# {"cmd":"read_rsp","did":"lumi","mi_spec":[{"siid":5,"piid":2,"value":0,"code":0}]}
items = data.get("results") or data.get("mi_spec")
elif cmd == "write_rsp" and data["did"] == "lumi.0":
# process write response only from Gateway
# {"cmd":"write_rsp","did":"lumi.0","results":[{"res_name":"8.0.2109","value":60,"error_code":0}]}
items = data.get("results")
items = data.get("results") or data.get("mi_spec")
else:
return

Expand Down

0 comments on commit 4cbcb19

Please sign in to comment.