From 9e65841cb12785561fd5166ac64eb3394b30f454 Mon Sep 17 00:00:00 2001 From: Thomas55555 <59625598+Thomas55555@users.noreply.github.com> Date: Sun, 27 Sep 2026 11:51:25 +0200 Subject: [PATCH] Add idle state to Husqvarna Automower (#183227) --- homeassistant/components/husqvarna_automower/const.py | 1 - homeassistant/components/husqvarna_automower/lawn_mower.py | 2 ++ .../husqvarna_automower/snapshots/test_sensor.ambr | 4 ---- tests/components/husqvarna_automower/test_lawn_mower.py | 5 +++++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/husqvarna_automower/const.py b/homeassistant/components/husqvarna_automower/const.py index 3fb21547a5f1..6e22504ae7b0 100644 --- a/homeassistant/components/husqvarna_automower/const.py +++ b/homeassistant/components/husqvarna_automower/const.py @@ -13,7 +13,6 @@ ERROR_STATES = [ MowerStates.ERROR, MowerStates.FATAL_ERROR, MowerStates.OFF, - MowerStates.STOPPED, MowerStates.WAIT_POWER_UP, MowerStates.WAIT_UPDATING, ] diff --git a/homeassistant/components/husqvarna_automower/lawn_mower.py b/homeassistant/components/husqvarna_automower/lawn_mower.py index 10ae9e61f0ee..95bef7295996 100644 --- a/homeassistant/components/husqvarna_automower/lawn_mower.py +++ b/homeassistant/components/husqvarna_automower/lawn_mower.py @@ -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 diff --git a/tests/components/husqvarna_automower/snapshots/test_sensor.ambr b/tests/components/husqvarna_automower/snapshots/test_sensor.ambr index fe9e2d9b5606..4794fc646fcc 100644 --- a/tests/components/husqvarna_automower/snapshots/test_sensor.ambr +++ b/tests/components/husqvarna_automower/snapshots/test_sensor.ambr @@ -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', diff --git a/tests/components/husqvarna_automower/test_lawn_mower.py b/tests/components/husqvarna_automower/test_lawn_mower.py index 5d5d05c0be84..919e0383c783 100644 --- a/tests/components/husqvarna_automower/test_lawn_mower.py +++ b/tests/components/husqvarna_automower/test_lawn_mower.py @@ -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(