Skip to content

Commit

Permalink
Merge pull request #224 from basbruss/223-crash-if-i-add-lux-entity
Browse files Browse the repository at this point in the history
Fix lux/irradiance comparison
  • Loading branch information
basbruss authored Jun 17, 2024
2 parents c593345 + 859284c commit 37f5cc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/adaptive_cover/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def lux(self) -> bool:
return False
if self.lux_entity is not None and self.lux_threshold is not None:
value = get_safe_state(self.hass, self.lux_entity)
return value <= self.lux_threshold
return float(value) <= self.lux_threshold
return False

@property
Expand All @@ -300,7 +300,7 @@ def irradiance(self) -> bool:
return False
if self.irradiance_entity is not None and self.irradiance_threshold is not None:
value = get_safe_state(self.hass, self.irradiance_entity)
return value <= self.irradiance_threshold
return float(value) <= self.irradiance_threshold
return False


Expand Down

0 comments on commit 37f5cc5

Please sign in to comment.