Skip to content

Commit

Permalink
update climate logic
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss committed Mar 14, 2024
1 parent bc85e2d commit c5f23fd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions custom_components/adaptive_cover/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()

Expand Down

0 comments on commit c5f23fd

Please sign in to comment.