Skip to content

Commit

Permalink
fix: mips msg id type parse
Browse files Browse the repository at this point in the history
  • Loading branch information
topsworld committed Dec 17, 2024
1 parent 507018d commit 9a78f32
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/xiaomi_home/miot/miot_mips.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ def unpack(data: bytes):
# string end with \x00
match unpack_type:
case MipsMsgTypeOptions.ID.value:
mips_msg.mid = int.from_bytes(
unpack_data, byteorder='little')
mips_msg.mid = struct.unpack('<I', unpack_data)[0]
case MipsMsgTypeOptions.RET_TOPIC.value:
mips_msg.ret_topic = str(
unpack_data.strip(b'\x00'), 'utf-8')
Expand Down

0 comments on commit 9a78f32

Please sign in to comment.