mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +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",
|
"fast forwarding": "fast_forwarding",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ROBOT_CLEANER_MOVEMENT_MAP = {
|
||||||
|
"powerOff": "off",
|
||||||
|
}
|
||||||
|
|
||||||
OVEN_MODE = {
|
OVEN_MODE = {
|
||||||
"Conventional": "conventional",
|
"Conventional": "conventional",
|
||||||
"Bake": "bake",
|
"Bake": "bake",
|
||||||
@ -625,6 +629,20 @@ CAPABILITY_TO_SENSORS: dict[
|
|||||||
SmartThingsSensorEntityDescription(
|
SmartThingsSensorEntityDescription(
|
||||||
key=Attribute.ROBOT_CLEANER_MOVEMENT,
|
key=Attribute.ROBOT_CLEANER_MOVEMENT,
|
||||||
translation_key="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"
|
"name": "Cleaning mode"
|
||||||
},
|
},
|
||||||
"robot_cleaner_movement": {
|
"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": {
|
"robot_cleaner_turbo_mode": {
|
||||||
"name": "Turbo mode"
|
"name": "Turbo mode"
|
||||||
|
@ -2563,7 +2563,20 @@
|
|||||||
'aliases': set({
|
'aliases': set({
|
||||||
}),
|
}),
|
||||||
'area_id': None,
|
'area_id': None,
|
||||||
'capabilities': None,
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'homing',
|
||||||
|
'idle',
|
||||||
|
'charging',
|
||||||
|
'alarm',
|
||||||
|
'off',
|
||||||
|
'reserve',
|
||||||
|
'point',
|
||||||
|
'after',
|
||||||
|
'cleaning',
|
||||||
|
'pause',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
'config_entry_id': <ANY>,
|
'config_entry_id': <ANY>,
|
||||||
'config_subentry_id': <ANY>,
|
'config_subentry_id': <ANY>,
|
||||||
'device_class': None,
|
'device_class': None,
|
||||||
@ -2581,7 +2594,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': 'Movement',
|
'original_name': 'Movement',
|
||||||
'platform': 'smartthings',
|
'platform': 'smartthings',
|
||||||
@ -2595,7 +2608,20 @@
|
|||||||
# name: test_all_entities[da_rvc_normal_000001][sensor.robot_vacuum_movement-state]
|
# name: test_all_entities[da_rvc_normal_000001][sensor.robot_vacuum_movement-state]
|
||||||
StateSnapshot({
|
StateSnapshot({
|
||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
'friendly_name': 'Robot vacuum Movement',
|
'friendly_name': 'Robot vacuum Movement',
|
||||||
|
'options': list([
|
||||||
|
'homing',
|
||||||
|
'idle',
|
||||||
|
'charging',
|
||||||
|
'alarm',
|
||||||
|
'off',
|
||||||
|
'reserve',
|
||||||
|
'point',
|
||||||
|
'after',
|
||||||
|
'cleaning',
|
||||||
|
'pause',
|
||||||
|
]),
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
'entity_id': 'sensor.robot_vacuum_movement',
|
'entity_id': 'sensor.robot_vacuum_movement',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user