mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Do not base power switch state on appliance's operation state at Home Connect (#135932)
This commit is contained in:
parent
3a078d5414
commit
57294fa461
@ -27,7 +27,6 @@ from .const import (
|
||||
ATTR_VALUE,
|
||||
BSH_ACTIVE_PROGRAM,
|
||||
BSH_CHILD_LOCK_STATE,
|
||||
BSH_OPERATION_STATE,
|
||||
BSH_POWER_OFF,
|
||||
BSH_POWER_ON,
|
||||
BSH_POWER_STANDBY,
|
||||
@ -403,23 +402,6 @@ class HomeConnectPowerSwitch(HomeConnectEntity, SwitchEntity):
|
||||
== self.power_off_state
|
||||
):
|
||||
self._attr_is_on = False
|
||||
elif self.device.appliance.status.get(BSH_OPERATION_STATE, {}).get(
|
||||
ATTR_VALUE, None
|
||||
) in [
|
||||
"BSH.Common.EnumType.OperationState.Ready",
|
||||
"BSH.Common.EnumType.OperationState.DelayedStart",
|
||||
"BSH.Common.EnumType.OperationState.Run",
|
||||
"BSH.Common.EnumType.OperationState.Pause",
|
||||
"BSH.Common.EnumType.OperationState.ActionRequired",
|
||||
"BSH.Common.EnumType.OperationState.Aborting",
|
||||
"BSH.Common.EnumType.OperationState.Finished",
|
||||
]:
|
||||
self._attr_is_on = True
|
||||
elif (
|
||||
self.device.appliance.status.get(BSH_OPERATION_STATE, {}).get(ATTR_VALUE)
|
||||
== "BSH.Common.EnumType.OperationState.Inactive"
|
||||
):
|
||||
self._attr_is_on = False
|
||||
else:
|
||||
self._attr_is_on = None
|
||||
_LOGGER.debug("Updated, new state: %s", self._attr_is_on)
|
||||
|
@ -13,7 +13,6 @@ from homeassistant.components.home_connect.const import (
|
||||
ATTR_CONSTRAINTS,
|
||||
BSH_ACTIVE_PROGRAM,
|
||||
BSH_CHILD_LOCK_STATE,
|
||||
BSH_OPERATION_STATE,
|
||||
BSH_POWER_OFF,
|
||||
BSH_POWER_ON,
|
||||
BSH_POWER_STANDBY,
|
||||
@ -376,32 +375,6 @@ async def test_ent_desc_switch_exception_handling(
|
||||
STATE_OFF,
|
||||
"Dishwasher",
|
||||
),
|
||||
(
|
||||
"switch.dishwasher_power",
|
||||
{
|
||||
BSH_POWER_STATE: {"value": ""},
|
||||
BSH_OPERATION_STATE: {
|
||||
"value": "BSH.Common.EnumType.OperationState.Run"
|
||||
},
|
||||
},
|
||||
[BSH_POWER_ON],
|
||||
SERVICE_TURN_ON,
|
||||
STATE_ON,
|
||||
"Dishwasher",
|
||||
),
|
||||
(
|
||||
"switch.dishwasher_power",
|
||||
{
|
||||
BSH_POWER_STATE: {"value": ""},
|
||||
BSH_OPERATION_STATE: {
|
||||
"value": "BSH.Common.EnumType.OperationState.Inactive"
|
||||
},
|
||||
},
|
||||
[BSH_POWER_ON],
|
||||
SERVICE_TURN_ON,
|
||||
STATE_OFF,
|
||||
"Dishwasher",
|
||||
),
|
||||
(
|
||||
"switch.dishwasher_power",
|
||||
{BSH_POWER_STATE: {"value": BSH_POWER_ON}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user