Fix config flow in Husqvarna Automower (#132615)
parent
b40d8074c0
commit
d32e69dcb6
|
@ -53,10 +53,10 @@ class HusqvarnaConfigFlowHandler(
|
||||||
tz = await dt_util.async_get_time_zone(str(dt_util.DEFAULT_TIME_ZONE))
|
tz = await dt_util.async_get_time_zone(str(dt_util.DEFAULT_TIME_ZONE))
|
||||||
automower_api = AutomowerSession(AsyncConfigFlowAuth(websession, token), tz)
|
automower_api = AutomowerSession(AsyncConfigFlowAuth(websession, token), tz)
|
||||||
try:
|
try:
|
||||||
data = await automower_api.get_status()
|
status_data = await automower_api.get_status()
|
||||||
except Exception: # noqa: BLE001
|
except Exception: # noqa: BLE001
|
||||||
return self.async_abort(reason="unknown")
|
return self.async_abort(reason="unknown")
|
||||||
if data == {}:
|
if status_data == {}:
|
||||||
return self.async_abort(reason="no_mower_connected")
|
return self.async_abort(reason="no_mower_connected")
|
||||||
|
|
||||||
structured_token = structure_token(token[CONF_ACCESS_TOKEN])
|
structured_token = structure_token(token[CONF_ACCESS_TOKEN])
|
||||||
|
|
Loading…
Reference in New Issue