Skip to content

Commit 37f5cc5

Browse files
authored
Merge pull request #224 from basbruss/223-crash-if-i-add-lux-entity
Fix lux/irradiance comparison
2 parents c593345 + 859284c commit 37f5cc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/adaptive_cover/calculation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def lux(self) -> bool:
290290
return False
291291
if self.lux_entity is not None and self.lux_threshold is not None:
292292
value = get_safe_state(self.hass, self.lux_entity)
293-
return value <= self.lux_threshold
293+
return float(value) <= self.lux_threshold
294294
return False
295295

296296
@property
@@ -300,7 +300,7 @@ def irradiance(self) -> bool:
300300
return False
301301
if self.irradiance_entity is not None and self.irradiance_threshold is not None:
302302
value = get_safe_state(self.hass, self.irradiance_entity)
303-
return value <= self.irradiance_threshold
303+
return float(value) <= self.irradiance_threshold
304304
return False
305305

306306

0 commit comments

Comments
 (0)