Handle netatmo exception (#16344)

This commit is contained in:
Daniel Høyer Iversen 2018-09-01 23:30:34 +02:00 committed by Fabian Affolter
parent a5d95dfbdc
commit b31890c4cb

View File

@ -317,7 +317,11 @@ class NetAtmoData:
try:
import pyatmo
self.station_data = pyatmo.WeatherStationData(self.auth)
try:
self.station_data = pyatmo.WeatherStationData(self.auth)
except TypeError:
_LOGGER.error("Failed to connect to NetAtmo")
return # finally statement will be executed
if self.station is not None:
self.data = self.station_data.lastData(