mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add translatable states to robot cleaner turbo mode in SmartThings (#139364)
This commit is contained in:
parent
468208502f
commit
3eea932b24
@ -61,6 +61,10 @@ MEDIA_PLAYBACK_STATE_MAP = {
|
|||||||
"fast forwarding": "fast_forwarding",
|
"fast forwarding": "fast_forwarding",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ROBOT_CLEANER_TURBO_MODE_STATE_MAP = {
|
||||||
|
"extraSilence": "extra_silence",
|
||||||
|
}
|
||||||
|
|
||||||
ROBOT_CLEANER_MOVEMENT_MAP = {
|
ROBOT_CLEANER_MOVEMENT_MAP = {
|
||||||
"powerOff": "off",
|
"powerOff": "off",
|
||||||
}
|
}
|
||||||
@ -655,6 +659,11 @@ CAPABILITY_TO_SENSORS: dict[
|
|||||||
SmartThingsSensorEntityDescription(
|
SmartThingsSensorEntityDescription(
|
||||||
key=Attribute.ROBOT_CLEANER_TURBO_MODE,
|
key=Attribute.ROBOT_CLEANER_TURBO_MODE,
|
||||||
translation_key="robot_cleaner_turbo_mode",
|
translation_key="robot_cleaner_turbo_mode",
|
||||||
|
options=["on", "off", "silence", "extra_silence"],
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
value_fn=lambda value: ROBOT_CLEANER_TURBO_MODE_STATE_MAP.get(
|
||||||
|
value, value
|
||||||
|
),
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
@ -278,7 +278,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"robot_cleaner_turbo_mode": {
|
"robot_cleaner_turbo_mode": {
|
||||||
"name": "Turbo mode"
|
"name": "Turbo mode",
|
||||||
|
"state": {
|
||||||
|
"on": "[%key:common::state::on%]",
|
||||||
|
"off": "[%key:common::state::off%]",
|
||||||
|
"silence": "Silent",
|
||||||
|
"extra_silence": "Extra silent"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"link_quality": {
|
"link_quality": {
|
||||||
"name": "Link quality"
|
"name": "Link quality"
|
||||||
|
@ -2654,7 +2654,14 @@
|
|||||||
'aliases': set({
|
'aliases': set({
|
||||||
}),
|
}),
|
||||||
'area_id': None,
|
'area_id': None,
|
||||||
'capabilities': None,
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'on',
|
||||||
|
'off',
|
||||||
|
'silence',
|
||||||
|
'extra_silence',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
'config_entry_id': <ANY>,
|
'config_entry_id': <ANY>,
|
||||||
'config_subentry_id': <ANY>,
|
'config_subentry_id': <ANY>,
|
||||||
'device_class': None,
|
'device_class': None,
|
||||||
@ -2672,7 +2679,7 @@
|
|||||||
'name': None,
|
'name': None,
|
||||||
'options': dict({
|
'options': dict({
|
||||||
}),
|
}),
|
||||||
'original_device_class': None,
|
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||||
'original_icon': None,
|
'original_icon': None,
|
||||||
'original_name': 'Turbo mode',
|
'original_name': 'Turbo mode',
|
||||||
'platform': 'smartthings',
|
'platform': 'smartthings',
|
||||||
@ -2686,7 +2693,14 @@
|
|||||||
# name: test_all_entities[da_rvc_normal_000001][sensor.robot_vacuum_turbo_mode-state]
|
# name: test_all_entities[da_rvc_normal_000001][sensor.robot_vacuum_turbo_mode-state]
|
||||||
StateSnapshot({
|
StateSnapshot({
|
||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
'friendly_name': 'Robot vacuum Turbo mode',
|
'friendly_name': 'Robot vacuum Turbo mode',
|
||||||
|
'options': list([
|
||||||
|
'on',
|
||||||
|
'off',
|
||||||
|
'silence',
|
||||||
|
'extra_silence',
|
||||||
|
]),
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
'entity_id': 'sensor.robot_vacuum_turbo_mode',
|
'entity_id': 'sensor.robot_vacuum_turbo_mode',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user