Bump aioautomower to 2024.5.1 (#117815)

This commit is contained in:
Thomas55555 2024-05-21 09:43:36 +02:00 committed by GitHub
parent 58d0ac7f21
commit bb758bcb26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 21 additions and 15 deletions

View File

@ -7,5 +7,5 @@
"documentation": "https://www.home-assistant.io/integrations/husqvarna_automower", "documentation": "https://www.home-assistant.io/integrations/husqvarna_automower",
"iot_class": "cloud_push", "iot_class": "cloud_push",
"loggers": ["aioautomower"], "loggers": ["aioautomower"],
"requirements": ["aioautomower==2024.5.0"] "requirements": ["aioautomower==2024.5.1"]
} }

View File

@ -30,8 +30,8 @@ def _async_get_cutting_height(data: MowerAttributes) -> int:
"""Return the cutting height.""" """Return the cutting height."""
if TYPE_CHECKING: if TYPE_CHECKING:
# Sensor does not get created if it is None # Sensor does not get created if it is None
assert data.cutting_height is not None assert data.settings.cutting_height is not None
return data.cutting_height return data.settings.cutting_height
@callback @callback
@ -84,7 +84,7 @@ NUMBER_TYPES: tuple[AutomowerNumberEntityDescription, ...] = (
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_min_value=1, native_min_value=1,
native_max_value=9, native_max_value=9,
exists_fn=lambda data: data.cutting_height is not None, exists_fn=lambda data: data.settings.cutting_height is not None,
value_fn=_async_get_cutting_height, value_fn=_async_get_cutting_height,
set_value_fn=async_set_cutting_height, set_value_fn=async_set_cutting_height,
), ),

View File

@ -59,7 +59,9 @@ class AutomowerSelectEntity(AutomowerControlEntity, SelectEntity):
@property @property
def current_option(self) -> str: def current_option(self) -> str:
"""Return the current option for the entity.""" """Return the current option for the entity."""
return cast(HeadlightModes, self.mower_attributes.headlight.mode).lower() return cast(
HeadlightModes, self.mower_attributes.settings.headlight.mode
).lower()
async def async_select_option(self, option: str) -> None: async def async_select_option(self, option: str) -> None:
"""Change the selected option.""" """Change the selected option."""

View File

@ -201,7 +201,7 @@ aioaseko==0.1.1
aioasuswrt==1.4.0 aioasuswrt==1.4.0
# homeassistant.components.husqvarna_automower # homeassistant.components.husqvarna_automower
aioautomower==2024.5.0 aioautomower==2024.5.1
# homeassistant.components.azure_devops # homeassistant.components.azure_devops
aioazuredevops==2.0.0 aioazuredevops==2.0.0

View File

@ -180,7 +180,7 @@ aioaseko==0.1.1
aioasuswrt==1.4.0 aioasuswrt==1.4.0
# homeassistant.components.husqvarna_automower # homeassistant.components.husqvarna_automower
aioautomower==2024.5.0 aioautomower==2024.5.1
# homeassistant.components.azure_devops # homeassistant.components.azure_devops
aioazuredevops==2.0.0 aioazuredevops==2.0.0

View File

@ -157,9 +157,11 @@
} }
] ]
}, },
"cuttingHeight": 4, "settings": {
"headlight": { "cuttingHeight": 4,
"mode": "EVENING_ONLY" "headlight": {
"mode": "EVENING_ONLY"
}
} }
} }
} }

View File

@ -54,10 +54,6 @@
'stay_out_zones': True, 'stay_out_zones': True,
'work_areas': True, 'work_areas': True,
}), }),
'cutting_height': 4,
'headlight': dict({
'mode': 'EVENING_ONLY',
}),
'metadata': dict({ 'metadata': dict({
'connected': True, 'connected': True,
'status_dateteime': '2023-10-18T22:58:52.683000+00:00', 'status_dateteime': '2023-10-18T22:58:52.683000+00:00',
@ -80,6 +76,12 @@
'restricted_reason': 'WEEK_SCHEDULE', 'restricted_reason': 'WEEK_SCHEDULE',
}), }),
'positions': '**REDACTED**', 'positions': '**REDACTED**',
'settings': dict({
'cutting_height': 4,
'headlight': dict({
'mode': 'EVENING_ONLY',
}),
}),
'statistics': dict({ 'statistics': dict({
'cutting_blade_usage_time': 123, 'cutting_blade_usage_time': 123,
'number_of_charging_cycles': 1380, 'number_of_charging_cycles': 1380,

View File

@ -46,7 +46,7 @@ async def test_select_states(
(HeadlightModes.ALWAYS_ON, "always_on"), (HeadlightModes.ALWAYS_ON, "always_on"),
(HeadlightModes.EVENING_AND_NIGHT, "evening_and_night"), (HeadlightModes.EVENING_AND_NIGHT, "evening_and_night"),
]: ]:
values[TEST_MOWER_ID].headlight.mode = state values[TEST_MOWER_ID].settings.headlight.mode = state
mock_automower_client.get_status.return_value = values mock_automower_client.get_status.return_value = values
freezer.tick(SCAN_INTERVAL) freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass) async_fire_time_changed(hass)