mirror of
https://github.com/home-assistant/core.git
synced 2026-10-07 06:50:41 -04:00
Add idle state to Husqvarna Automower (#183227)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user