mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Add translatable states to oven job state in SmartThings (#139361)
This commit is contained in:
parent
fc1190dafd
commit
b777c29bab
@ -49,6 +49,14 @@ JOB_STATE_MAP = {
|
||||
"unknown": None,
|
||||
}
|
||||
|
||||
OVEN_JOB_STATE_MAP = {
|
||||
"scheduledStart": "scheduled_start",
|
||||
"fastPreheat": "fast_preheat",
|
||||
"scheduledEnd": "scheduled_end",
|
||||
"stone_heating": "stone_heating",
|
||||
"timeHoldPreheat": "time_hold_preheat",
|
||||
}
|
||||
|
||||
MEDIA_PLAYBACK_STATE_MAP = {
|
||||
"fast forwarding": "fast_forwarding",
|
||||
}
|
||||
@ -480,6 +488,27 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
SmartThingsSensorEntityDescription(
|
||||
key=Attribute.OVEN_JOB_STATE,
|
||||
translation_key="oven_job_state",
|
||||
options=[
|
||||
"cleaning",
|
||||
"cooking",
|
||||
"cooling",
|
||||
"draining",
|
||||
"preheat",
|
||||
"ready",
|
||||
"rinsing",
|
||||
"finished",
|
||||
"scheduled_start",
|
||||
"warming",
|
||||
"defrosting",
|
||||
"sensing",
|
||||
"searing",
|
||||
"fast_preheat",
|
||||
"scheduled_end",
|
||||
"stone_heating",
|
||||
"time_hold_preheat",
|
||||
],
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
value_fn=lambda value: OVEN_JOB_STATE_MAP.get(value, value),
|
||||
)
|
||||
],
|
||||
Attribute.COMPLETION_TIME: [
|
||||
|
@ -207,7 +207,26 @@
|
||||
"name": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::name%]"
|
||||
},
|
||||
"oven_job_state": {
|
||||
"name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]"
|
||||
"name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]",
|
||||
"state": {
|
||||
"cleaning": "Cleaning",
|
||||
"cooking": "Cooking",
|
||||
"cooling": "Cooling",
|
||||
"draining": "Draining",
|
||||
"preheat": "Preheat",
|
||||
"ready": "Ready",
|
||||
"rinsing": "Rinsing",
|
||||
"finished": "Finished",
|
||||
"scheduled_start": "Scheduled start",
|
||||
"warming": "Warming",
|
||||
"defrosting": "Defrosting",
|
||||
"sensing": "Sensing",
|
||||
"searing": "Searing",
|
||||
"fast_preheat": "Fast preheat",
|
||||
"scheduled_end": "Scheduled end",
|
||||
"stone_heating": "Stone heating",
|
||||
"time_hold_preheat": "Time hold preheat"
|
||||
}
|
||||
},
|
||||
"oven_setpoint": {
|
||||
"name": "Set point"
|
||||
|
@ -1758,7 +1758,27 @@
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'cleaning',
|
||||
'cooking',
|
||||
'cooling',
|
||||
'draining',
|
||||
'preheat',
|
||||
'ready',
|
||||
'rinsing',
|
||||
'finished',
|
||||
'scheduled_start',
|
||||
'warming',
|
||||
'defrosting',
|
||||
'sensing',
|
||||
'searing',
|
||||
'fast_preheat',
|
||||
'scheduled_end',
|
||||
'stone_heating',
|
||||
'time_hold_preheat',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@ -1776,7 +1796,7 @@
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Job state',
|
||||
'platform': 'smartthings',
|
||||
@ -1790,7 +1810,27 @@
|
||||
# name: test_all_entities[da_ks_microwave_0101x][sensor.microwave_job_state-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'enum',
|
||||
'friendly_name': 'Microwave Job state',
|
||||
'options': list([
|
||||
'cleaning',
|
||||
'cooking',
|
||||
'cooling',
|
||||
'draining',
|
||||
'preheat',
|
||||
'ready',
|
||||
'rinsing',
|
||||
'finished',
|
||||
'scheduled_start',
|
||||
'warming',
|
||||
'defrosting',
|
||||
'sensing',
|
||||
'searing',
|
||||
'fast_preheat',
|
||||
'scheduled_end',
|
||||
'stone_heating',
|
||||
'time_hold_preheat',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.microwave_job_state',
|
||||
|
Loading…
x
Reference in New Issue
Block a user