Fix Netatmo data class update (#51215)

* Catch if data class entry is None

* Guard
pull/51238/head
Tobias Sauerwein 2021-05-29 14:10:45 +02:00 committed by GitHub
parent d1132270b4
commit d66d7cbd37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -101,8 +101,7 @@ class NetatmoDataHandler:
time() + data_class["interval"]
)
if self.data_classes[data_class_name]["subscriptions"]:
await self.async_fetch_data(data_class_name)
await self.async_fetch_data(data_class_name)
self._queue.rotate(BATCH_SIZE)
@ -133,6 +132,9 @@ class NetatmoDataHandler:
async def async_fetch_data(self, data_class_entry):
"""Fetch data and notify."""
if self.data[data_class_entry] is None:
return
try:
await self.data[data_class_entry].async_update()