mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +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",
|
||||
}
|
||||
|
||||
ROBOT_CLEANER_TURBO_MODE_STATE_MAP = {
|
||||
"extraSilence": "extra_silence",
|
||||
}
|
||||
|
||||
ROBOT_CLEANER_MOVEMENT_MAP = {
|
||||
"powerOff": "off",
|
||||
}
|
||||
@ -655,6 +659,11 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
SmartThingsSensorEntityDescription(
|
||||
key=Attribute.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,
|
||||
)
|
||||
]
|
||||
|
@ -278,7 +278,13 @@
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"name": "Link quality"
|
||||
|
@ -2654,7 +2654,14 @@
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'on',
|
||||
'off',
|
||||
'silence',
|
||||
'extra_silence',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@ -2672,7 +2679,7 @@
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Turbo mode',
|
||||
'platform': 'smartthings',
|
||||
@ -2686,7 +2693,14 @@
|
||||
# name: test_all_entities[da_rvc_normal_000001][sensor.robot_vacuum_turbo_mode-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'enum',
|
||||
'friendly_name': 'Robot vacuum Turbo mode',
|
||||
'options': list([
|
||||
'on',
|
||||
'off',
|
||||
'silence',
|
||||
'extra_silence',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.robot_vacuum_turbo_mode',
|
||||
|
Loading…
x
Reference in New Issue
Block a user