Skip to content

Commit

Permalink
Merge pull request #77 from basbruss/dev
Browse files Browse the repository at this point in the history
Update weather logic
  • Loading branch information
basbruss authored Mar 21, 2024
2 parents 16c1d51 + c5f23fd commit f0ff6c7
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 @@ -200,7 +200,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 @@ -212,11 +212,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 @@ -227,7 +223,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 f0ff6c7

Please sign in to comment.