Add idle state to Husqvarna Automower (#183227)

This commit is contained in:
Thomas55555
2026-09-27 11:51:25 +02:00
committed by GitHub
parent c1a7f5af88
commit 9e65841cb1
4 changed files with 7 additions and 5 deletions
@@ -13,7 +13,6 @@ ERROR_STATES = [
MowerStates.ERROR,
MowerStates.FATAL_ERROR,
MowerStates.OFF,
MowerStates.STOPPED,
MowerStates.WAIT_POWER_UP,
MowerStates.WAIT_UPDATING,
]
@@ -87,6 +87,8 @@ class AutomowerLawnMowerEntity(AutomowerBaseEntity, LawnMowerEntity):
or mower_attributes.mower.activity in DOCKED_ACTIVITIES
):
return LawnMowerActivity.DOCKED
if mower_attributes.mower.state is MowerStates.STOPPED:
return LawnMowerActivity.IDLE
if mower_attributes.mower.state in MowerStates.IN_OPERATION:
return LawnMowerActivity.MOWING
return LawnMowerActivity.ERROR
@@ -307,7 +307,6 @@
'slope_too_steep',
'sms_could_not_be_sent',
'stop_button_problem',
'stopped',
'stuck_in_charging_station',
'switch_cord_problem',
'temporary_battery_problem',
@@ -509,7 +508,6 @@
'slope_too_steep',
'sms_could_not_be_sent',
'stop_button_problem',
'stopped',
'stuck_in_charging_station',
'switch_cord_problem',
'temporary_battery_problem',
@@ -1836,7 +1834,6 @@
'slope_too_steep',
'sms_could_not_be_sent',
'stop_button_problem',
'stopped',
'stuck_in_charging_station',
'switch_cord_problem',
'temporary_battery_problem',
@@ -2038,7 +2035,6 @@
'slope_too_steep',
'sms_could_not_be_sent',
'stop_button_problem',
'stopped',
'stuck_in_charging_station',
'switch_cord_problem',
'temporary_battery_problem',
@@ -47,6 +47,11 @@ from tests.common import MockConfigEntry, async_fire_time_changed
MowerStates.RESTRICTED,
LawnMowerActivity.RETURNING,
),
(
MowerActivities.NOT_APPLICABLE,
MowerStates.STOPPED,
LawnMowerActivity.IDLE,
),
],
)
async def test_lawn_mower_states(