mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Add select entity for dishwasher operating state in SmartThings (#141468)
* Add select entity for dishwasher operating state in SmartThings * Add select entity for dishwasher operating state in SmartThings
This commit is contained in:
parent
054b3bb26c
commit
21d5885ded
@ -28,6 +28,15 @@ class SmartThingsSelectDescription(SelectEntityDescription):
|
|||||||
|
|
||||||
|
|
||||||
CAPABILITIES_TO_SELECT: dict[Capability | str, SmartThingsSelectDescription] = {
|
CAPABILITIES_TO_SELECT: dict[Capability | str, SmartThingsSelectDescription] = {
|
||||||
|
Capability.DISHWASHER_OPERATING_STATE: SmartThingsSelectDescription(
|
||||||
|
key=Capability.DISHWASHER_OPERATING_STATE,
|
||||||
|
name=None,
|
||||||
|
translation_key="operating_state",
|
||||||
|
requires_remote_control_status=True,
|
||||||
|
options_attribute=Attribute.SUPPORTED_MACHINE_STATES,
|
||||||
|
status_attribute=Attribute.MACHINE_STATE,
|
||||||
|
command=Command.SET_MACHINE_STATE,
|
||||||
|
),
|
||||||
Capability.DRYER_OPERATING_STATE: SmartThingsSelectDescription(
|
Capability.DRYER_OPERATING_STATE: SmartThingsSelectDescription(
|
||||||
key=Capability.DRYER_OPERATING_STATE,
|
key=Capability.DRYER_OPERATING_STATE,
|
||||||
name=None,
|
name=None,
|
||||||
|
@ -1103,7 +1103,11 @@ class SmartThingsSensor(SmartThingsEntity, SensorEntity):
|
|||||||
await super().async_added_to_hass()
|
await super().async_added_to_hass()
|
||||||
if (
|
if (
|
||||||
self.capability
|
self.capability
|
||||||
not in {Capability.DRYER_OPERATING_STATE, Capability.WASHER_OPERATING_STATE}
|
not in {
|
||||||
|
Capability.DISHWASHER_OPERATING_STATE,
|
||||||
|
Capability.DRYER_OPERATING_STATE,
|
||||||
|
Capability.WASHER_OPERATING_STATE,
|
||||||
|
}
|
||||||
or self._attribute is not Attribute.MACHINE_STATE
|
or self._attribute is not Attribute.MACHINE_STATE
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
@ -1142,7 +1146,11 @@ class SmartThingsSensor(SmartThingsEntity, SensorEntity):
|
|||||||
await super().async_will_remove_from_hass()
|
await super().async_will_remove_from_hass()
|
||||||
if (
|
if (
|
||||||
self.capability
|
self.capability
|
||||||
not in {Capability.DRYER_OPERATING_STATE, Capability.WASHER_OPERATING_STATE}
|
not in {
|
||||||
|
Capability.DISHWASHER_OPERATING_STATE,
|
||||||
|
Capability.DRYER_OPERATING_STATE,
|
||||||
|
Capability.WASHER_OPERATING_STATE,
|
||||||
|
}
|
||||||
or self._attribute is not Attribute.MACHINE_STATE
|
or self._attribute is not Attribute.MACHINE_STATE
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
@ -1,4 +1,62 @@
|
|||||||
# serializer version: 1
|
# serializer version: 1
|
||||||
|
# name: test_all_entities[da_wm_dw_000001][select.dishwasher-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'stop',
|
||||||
|
'run',
|
||||||
|
'pause',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'select',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'select.dishwasher',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'smartthings',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'operating_state',
|
||||||
|
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_machineState_machineState',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_all_entities[da_wm_dw_000001][select.dishwasher-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'Dishwasher',
|
||||||
|
'options': list([
|
||||||
|
'stop',
|
||||||
|
'run',
|
||||||
|
'pause',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'select.dishwasher',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'stop',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_all_entities[da_wm_wd_000001][select.dryer-entry]
|
# name: test_all_entities[da_wm_wd_000001][select.dryer-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user