From feb1518fc37cbf23127204917be011bcd7766907 Mon Sep 17 00:00:00 2001 From: herzogt Date: Wed, 13 May 2020 22:24:59 +0200 Subject: [PATCH] Fix environmental sensor state when device is off --- libpurecoollink/dyson_pure_state.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libpurecoollink/dyson_pure_state.py b/libpurecoollink/dyson_pure_state.py index b9c3d93..8150414 100644 --- a/libpurecoollink/dyson_pure_state.py +++ b/libpurecoollink/dyson_pure_state.py @@ -114,12 +114,13 @@ def __init__(self, payload): humidity = self.__get_field_value(data, 'hact') self._humidity = 0 if humidity == 'OFF' else int(humidity) volatil_copounds = self.__get_field_value(data, 'vact') - self._volatil_compounds = 0 if volatil_copounds == 'INIT' else int( + self._volatil_compounds = 0 if volatil_copounds in ['INIT', 'OFF'] else int( volatil_copounds) temperature = self.__get_field_value(data, 'tact') self._temperature = 0 if temperature == 'OFF' else float( temperature) / 10 - self._dust = int(self.__get_field_value(data, 'pact')) + dust = self.__get_field_value(data, 'pact') + self._dust = 0 if dust == 'OFF' else int(dust) sltm = self.__get_field_value(data, 'sltm') self._sleep_timer = 0 if sltm == 'OFF' else int(sltm)