From c2f949a95629fdee2fc8a5f22b2806ab3176f71b Mon Sep 17 00:00:00 2001 From: DarkByteZero Date: Mon, 8 Aug 2022 23:53:11 +0200 Subject: [PATCH] Update miflora_poller.py first fix for Mi Flora Max --- miflora/miflora_poller.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/miflora/miflora_poller.py b/miflora/miflora_poller.py index 93a5937..c797c32 100644 --- a/miflora/miflora_poller.py +++ b/miflora/miflora_poller.py @@ -104,6 +104,7 @@ def fill_cache(self): datetime.now() - self._cache_timeout + timedelta(seconds=300) ) return + time.sleep(1) # without this, the previous write_handle is done after we read the data self._cache = connection.read_handle( _HANDLE_READ_SENSOR_DATA ) # pylint: disable=no-member @@ -200,10 +201,13 @@ def _check_data(self): if self._cache[7] > 100: # moisture over 100 procent self.clear_cache() return - if self._firmware_version >= "2.6.6": - if sum(self._cache[10:]) == 0: - self.clear_cache() - return + # I have no idea why this exists? ( Mi Flora Max Data: B6 00 63 00 00 00 00 38 8D 02 00 00 00 00 00 00 ) + # With this cleaning, the cache is always empty. + + #if self._firmware_version >= "2.6.6": + # if sum(self._cache[10:]) == 0: + # self.clear_cache() + # return if sum(self._cache) == 0: self.clear_cache() return