mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add translatable states to robot cleaner movement in SmartThings (#139363)
This commit is contained in:
parent
51099ae7d6
commit
cadee73da8
@ -61,6 +61,10 @@ MEDIA_PLAYBACK_STATE_MAP = {
|
||||
"fast forwarding": "fast_forwarding",
|
||||
}
|
||||
|
||||
ROBOT_CLEANER_MOVEMENT_MAP = {
|
||||
"powerOff": "off",
|
||||
}
|
||||
|
||||
OVEN_MODE = {
|
||||
"Conventional": "conventional",
|
||||
"Bake": "bake",
|
||||
@ -625,6 +629,20 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
SmartThingsSensorEntityDescription(
|
||||
key=Attribute.ROBOT_CLEANER_MOVEMENT,
|
||||
translation_key="robot_cleaner_movement",
|
||||
options=[
|
||||
"homing",
|
||||
"idle",
|
||||
"charging",
|
||||
"alarm",
|
||||
"off",
|
||||
"reserve",
|
||||
"point",
|
||||
"after",
|
||||
"cleaning",
|
||||
"pause",
|
||||
],
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
value_fn=lambda value: ROBOT_CLEANER_MOVEMENT_MAP.get(value, value),
|
||||
)
|
||||
]
|
||||
},
|
||||
|
@ -255,7 +255,19 @@
|
||||
"name": "Cleaning mode"
|
||||
},
|
||||
"robot_cleaner_movement": {
|
||||
"name": "Movement"
|
||||
"name": "Movement",
|
||||
"state": {
|
||||
"homing": "Homing",
|
||||
"idle": "[%key:common::state::idle%]",
|
||||
"charging": "[%key:common::state::charging%]",
|
||||
"alarm": "Alarm",
|
||||
"off": "[%key:common::state::off%]",
|
||||
"reserve": "Reserve",
|
||||
"point": "Point",
|
||||
"after": "After",
|
||||
"cleaning": "Cleaning",
|
||||
"pause": "[%key:common::state::paused%]"
|
||||
}
|
||||
},
|
||||
"robot_cleaner_turbo_mode": {
|
||||
"name": "Turbo mode"
|
||||
|
@ -2563,7 +2563,20 @@
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'homing',
|
||||
'idle',
|
||||
'charging',
|
||||
'alarm',
|
||||
'off',
|
||||
'reserve',
|
||||
'point',
|
||||
'after',
|
||||
'cleaning',
|
||||
'pause',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@ -2581,7 +2594,7 @@
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Movement',
|
||||
'platform': 'smartthings',
|
||||
@ -2595,7 +2608,20 @@
|
||||
# name: test_all_entities[da_rvc_normal_000001][sensor.robot_vacuum_movement-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'enum',
|
||||
'friendly_name': 'Robot vacuum Movement',
|
||||
'options': list([
|
||||
'homing',
|
||||
'idle',
|
||||
'charging',
|
||||
'alarm',
|
||||
'off',
|
||||
'reserve',
|
||||
'point',
|
||||
'after',
|
||||
'cleaning',
|
||||
'pause',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.robot_vacuum_movement',
|
||||
|
Loading…
x
Reference in New Issue
Block a user