From e96e70f065022ce2122f0e175e47dd585401e4cb Mon Sep 17 00:00:00 2001 From: kolos Date: Sat, 7 Oct 2023 14:42:11 +0200 Subject: [PATCH 1/2] add json decode quirk for xiaomi e10 --- miio/protocol.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miio/protocol.py b/miio/protocol.py index 3902d35b6..10768a893 100644 --- a/miio/protocol.py +++ b/miio/protocol.py @@ -186,6 +186,10 @@ 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): From b645492520f9f7b5176dcb2ce05cf7af2ebb122c Mon Sep 17 00:00:00 2001 From: kolos Date: Sat, 7 Oct 2023 21:43:51 +0200 Subject: [PATCH 2/2] fix the linting issues --- miio/protocol.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/miio/protocol.py b/miio/protocol.py index 10768a893..eae43dd9e 100644 --- a/miio/protocol.py +++ b/miio/protocol.py @@ -187,9 +187,7 @@ def _decode(self, obj, context, path) -> Union[Dict, bytes]: 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',' - ), + lambda decrypted_bytes: decrypted_bytes.replace(b",,", b","), ] for i, quirk in enumerate(decrypted_quirks):