mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Fix possible OpenUV exception due to missing data (#26958)
This commit is contained in:
parent
ac634d71f4
commit
ce97c27a7f
@ -102,6 +102,11 @@ class OpenUvBinarySensor(OpenUvEntity, BinarySensorDevice):
|
|||||||
if not data:
|
if not data:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
for key in ("from_time", "to_time", "from_uv", "to_uv"):
|
||||||
|
if not data.get(key):
|
||||||
|
_LOGGER.info("Skipping update due to missing data: %s", key)
|
||||||
|
return
|
||||||
|
|
||||||
if self._sensor_type == TYPE_PROTECTION_WINDOW:
|
if self._sensor_type == TYPE_PROTECTION_WINDOW:
|
||||||
self._state = (
|
self._state = (
|
||||||
parse_datetime(data["from_time"])
|
parse_datetime(data["from_time"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user