From 4390234d4002d57510f3aec0320b4f050ecb204a Mon Sep 17 00:00:00 2001 From: kolos Date: Sat, 7 Oct 2023 22:02:28 +0200 Subject: [PATCH] add json decode quirk for xiaomi e10 (#1837) Fixes decode JSON error caused by a double comma, likely due to missing a property in the response. --- miio/protocol.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miio/protocol.py b/miio/protocol.py index 0a7a0158d..3195e7acd 100644 --- a/miio/protocol.py +++ b/miio/protocol.py @@ -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):