Allow OpenUV entities to be unavailable (#31018)
* Allow OpenUV entities to be unavailable * Empty commit to re-trigger build
This commit is contained in:
parent
1639432463
commit
662c12715e
3 changed files with 17 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue