Add translatable states to robot cleaner turbo mode in SmartThings (#139364)

This commit is contained in:
Joost Lekkerkerker 2025-02-26 17:53:16 +01:00 committed by GitHub
parent 468208502f
commit 3eea932b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 3 deletions

View File

@ -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,
)
]

View File

@ -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"

View File

@ -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',