Allow OpenUV entities to be unavailable (#31018)

* Allow OpenUV entities to be unavailable

* Empty commit to re-trigger build
This commit is contained in:
Aaron Bach authored and GitHub committed 2020-01-20 13:33:58 -07:00
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)