Skip to content

Commit

Permalink
add json decode quirk for xiaomi e10 (#1837)
Browse files Browse the repository at this point in the history
Fixes decode JSON error caused by a double comma, likely due to missing a property in the response.
  • Loading branch information
kolos authored Oct 7, 2023
1 parent fb69fbc commit 4390234
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions miio/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ def _decode(self, obj, context, path) -> Union[Dict, bytes]:
lambda decrypted_bytes: decrypted_bytes.replace(
b'"value":00', b'"value":0'
),
# fix double commas for xiaomi.vacuum.b112, fw: 2.2.4_0049
lambda decrypted_bytes: decrypted_bytes.replace(b",,", b","),
]

for i, quirk in enumerate(decrypted_quirks):
Expand Down

0 comments on commit 4390234

Please sign in to comment.