From c5f23fd7e61e746945accc0c7b9c952bb5f6c761 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:56:25 +0100 Subject: [PATCH] update climate logic --- custom_components/adaptive_cover/calculation.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/custom_components/adaptive_cover/calculation.py b/custom_components/adaptive_cover/calculation.py index 3f84021..8121376 100644 --- a/custom_components/adaptive_cover/calculation.py +++ b/custom_components/adaptive_cover/calculation.py @@ -203,7 +203,7 @@ def is_sunny(self) -> bool: weather_state = get_safe_state(self.hass, self.weather_entity) if self.weather_condition is not None: return weather_state in self.weather_condition - return False + return True @dataclass @@ -215,11 +215,7 @@ class ClimateCoverState(NormalCoverState): def normal_type_cover(self) -> int: """Determine state for horizontal and vertical covers.""" # glare does not matter - if ( - self.climate_data.is_presence is False - and self.climate_data.current_temperature is not None - and self.cover.sol_elev > 0 - ): + if self.climate_data.is_presence is False and self.cover.sol_elev > 0: # allow maximum solar radiation if self.climate_data.is_winter: return 100 @@ -230,7 +226,7 @@ def normal_type_cover(self) -> int: # prefer glare reduction over climate control # adjust according basic algorithm - if not self.climate_data.is_sunny and self.climate_data.is_winter: + if not self.climate_data.is_sunny and not self.climate_data.is_summer: return self.cover.default return super().get_state()