mirror of
https://github.com/home-assistant/core.git
synced 2025-08-09 23:55:07 +02:00
Handle netatmo exception (#16344)
This commit is contained in:
committed by
Fabian Affolter
parent
a5d95dfbdc
commit
b31890c4cb
@@ -317,7 +317,11 @@ class NetAtmoData:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import pyatmo
|
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:
|
if self.station is not None:
|
||||||
self.data = self.station_data.lastData(
|
self.data = self.station_data.lastData(
|
||||||
|
Reference in New Issue
Block a user