Allow OpenUV entities to be unavailable (#31018)
* Allow OpenUV entities to be unavailable * Empty commit to re-trigger build
This commit is contained in:
1 parent
1639432463
commit
662c12715e
3 files changed
+17
-1
No files matched your search
@@ -100,8 +100,11 @@ class OpenUvBinarySensor(OpenUvEntity, BinarySensorDevice):
|
||||
data = self.openuv.data[DATA_PROTECTION_WINDOW]
|
||||
|
||||
if not data:
|
||||
self._available = False
|
||||
return
|
||||
|
||||
self._available = True
|
||||
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user