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 2020-01-20 13:33:58 -07:00 committed by GitHub
parent 1639432463
commit 662c12715e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -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)