Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homeassistant/components/husqvarna_automower/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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
Expand Down Expand Up @@ -34,7 +34,7 @@ async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResu
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)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/husqvarna_automower/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 26 additions & 4 deletions tests/components/husqvarna_automower/fixtures/mower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -120,10 +132,6 @@
"longitude": -82.5520054
}
],
"cuttingHeight": 4,
"headlight": {
"mode": "EVENING_ONLY"
},
"statistics": {
"cuttingBladeUsageTime": 123,
"numberOfChargingCycles": 1380,
Expand All @@ -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"
}
}
}
Expand Down