From 9a647d9b17ee6b7f1d7aa4f664ef3bd2da0b6b04 Mon Sep 17 00:00:00 2001 From: Thomas55555 <59625598+Thomas55555@users.noreply.github.com> Date: Sun, 10 Mar 2024 22:10:27 +0100 Subject: [PATCH] Bump aioautomower to 2024.3.0 (#112627) Fix error in Husqvarna automower in Zones dataclass --- .../husqvarna_automower/config_flow.py | 4 +-- .../husqvarna_automower/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- .../husqvarna_automower/fixtures/mower.json | 30 ++++++++++++++++--- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/husqvarna_automower/config_flow.py b/homeassistant/components/husqvarna_automower/config_flow.py index 88b4899ff12..b25a185c75f 100644 --- a/homeassistant/components/husqvarna_automower/config_flow.py +++ b/homeassistant/components/husqvarna_automower/config_flow.py @@ -4,7 +4,7 @@ from collections.abc import Mapping import logging from typing import Any -from aioautomower.utils import async_structure_token +from aioautomower.utils import structure_token from homeassistant.config_entries import ConfigEntry, ConfigFlowResult from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN @@ -34,7 +34,7 @@ class HusqvarnaConfigFlowHandler( if self.reauth_entry.unique_id != user_id: return self.async_abort(reason="wrong_account") return self.async_update_reload_and_abort(self.reauth_entry, data=data) - structured_token = await async_structure_token(token[CONF_ACCESS_TOKEN]) + structured_token = structure_token(token[CONF_ACCESS_TOKEN]) first_name = structured_token.user.first_name last_name = structured_token.user.last_name await self.async_set_unique_id(user_id) diff --git a/homeassistant/components/husqvarna_automower/manifest.json b/homeassistant/components/husqvarna_automower/manifest.json index dc40116f31e..525f057c1ff 100644 --- a/homeassistant/components/husqvarna_automower/manifest.json +++ b/homeassistant/components/husqvarna_automower/manifest.json @@ -6,5 +6,5 @@ "dependencies": ["application_credentials"], "documentation": "https://www.home-assistant.io/integrations/husqvarna_automower", "iot_class": "cloud_push", - "requirements": ["aioautomower==2024.2.10"] + "requirements": ["aioautomower==2024.3.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 6a0fc5031b4..64282d37743 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -203,7 +203,7 @@ aioaseko==0.1.1 aioasuswrt==1.4.0 # homeassistant.components.husqvarna_automower -aioautomower==2024.2.10 +aioautomower==2024.3.0 # homeassistant.components.azure_devops aioazuredevops==1.3.5 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ac87156f109..ff423968b11 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -182,7 +182,7 @@ aioaseko==0.1.1 aioasuswrt==1.4.0 # homeassistant.components.husqvarna_automower -aioautomower==2024.2.10 +aioautomower==2024.3.0 # homeassistant.components.azure_devops aioazuredevops==1.3.5 diff --git a/tests/components/husqvarna_automower/fixtures/mower.json b/tests/components/husqvarna_automower/fixtures/mower.json index 0af4926c561..1e608e654a6 100644 --- a/tests/components/husqvarna_automower/fixtures/mower.json +++ b/tests/components/husqvarna_automower/fixtures/mower.json @@ -62,6 +62,18 @@ "connected": true, "statusTimestamp": 1697669932683 }, + "workAreas": [ + { + "workAreaId": 123456, + "name": "Front lawn", + "cuttingHeight": 50 + }, + { + "workAreaId": 0, + "name": "", + "cuttingHeight": 50 + } + ], "positions": [ { "latitude": 35.5402913, @@ -120,10 +132,6 @@ "longitude": -82.5520054 } ], - "cuttingHeight": 4, - "headlight": { - "mode": "EVENING_ONLY" - }, "statistics": { "cuttingBladeUsageTime": 123, "numberOfChargingCycles": 1380, @@ -133,6 +141,20 @@ "totalDriveDistance": 1780272, "totalRunningTime": 4564800, "totalSearchingTime": 370800 + }, + "stayOutZones": { + "dirty": false, + "zones": [ + { + "id": "81C6EEA2-D139-4FEA-B134-F22A6B3EA403", + "name": "Springflowers", + "enabled": true + } + ] + }, + "cuttingHeight": 4, + "headlight": { + "mode": "EVENING_ONLY" } } }