From bfcdf71760bf8242ffc37e920cf606e9961e5d66 Mon Sep 17 00:00:00 2001 From: Starter Date: Sun, 4 Jul 2021 12:48:52 +0800 Subject: [PATCH] Update protocol core to fix SKV4093GL connection problem SKV4093GL (aka STYTJ01ZHM aka dreame.vacuum.mc1808) connection problem was referenced first in #1066, later in #1086, and the working (as for me) fix was provided by @anonymous-one. However @rytilahti [suggested](https://github.com/rytilahti/python-miio/issues/1066#issuecomment-872536431) another way to fix this problem, I'd like to request to accept @anonymous-one's solution of the problem as the fastest one. --- miio/miioprotocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miio/miioprotocol.py b/miio/miioprotocol.py index 1075b9642..424e6e284 100644 --- a/miio/miioprotocol.py +++ b/miio/miioprotocol.py @@ -258,11 +258,11 @@ def send( @property def _id(self) -> int: """Increment and return the sequence id.""" - self.__id += 1 + self.__id += random.randint(1, 100) if self.__id >= 9999: self.__id = 1 return self.__id - + @property def raw_id(self): return self.__id