OpenUV: Fixed issue with missing protection window data (#17051)
This commit is contained in:
1 parent
0954eefa9f
commit
71e3047f5c
2 files changed
+14
-3
No files matched your search
@@ -93,7 +93,11 @@ class OpenUvBinarySensor(OpenUvEntity, BinarySensorDevice):
|
||||
|
||||
async def async_update(self):
|
||||
"""Update the state."""
|
||||
data = self.openuv.data[DATA_PROTECTION_WINDOW]['result']
|
||||
data = self.openuv.data[DATA_PROTECTION_WINDOW]
|
||||
|
||||
if not data:
|
||||
return
|
||||
|
||||
if self._sensor_type == TYPE_PROTECTION_WINDOW:
|
||||
self._state = parse_datetime(
|
||||
data['from_time']) <= utcnow() <= parse_datetime(
|
||||
|
||||
Reference in new issue
Block a user