Fix config flow in Husqvarna Automower (#132615)

pull/131867/head^2
Thomas55555 2024-12-08 15:59:27 +01:00 committed by GitHub
parent b40d8074c0
commit d32e69dcb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

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