Add drying step sensor for Miele tumble dryers (#144515)

Add drying step sensor for tumple dryers
This commit is contained in:
Åke Strandberg 2025-05-09 11:52:30 +02:00 committed by GitHub
parent 90a7ecdce3
commit 9abb4ffc97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 48 additions and 0 deletions

View File

@ -339,6 +339,20 @@ class StateProgramType(MieleEnum):
unknown = -9999
class StateDryingStep(MieleEnum):
"""Defines drying steps."""
extra_dry = 0
normal_plus = 1
normal = 2
slightly_dry = 3
hand_iron_1 = 4
hand_iron_2 = 5
machine_iron = 6
smoothing = 7
unknown = -9999
WASHING_MACHINE_PROGRAM_ID: dict[int, str] = {
-1: "no_program", # Extrapolated from other device types.
0: "no_program", # Returned by the API when no program is selected.

View File

@ -32,6 +32,9 @@
"core_target_temperature": {
"default": "mdi:thermometer-probe"
},
"drying_step": {
"default": "mdi:water-outline"
},
"program_id": {
"default": "mdi:selection-ellipse-arrow-inside"
},

View File

@ -32,6 +32,7 @@ from .const import (
STATE_PROGRAM_PHASE,
STATE_STATUS_TAGS,
MieleAppliance,
StateDryingStep,
StateProgramType,
StateStatus,
)
@ -416,6 +417,23 @@ SENSOR_TYPES: Final[tuple[MieleSensorDefinition, ...]] = (
),
),
),
MieleSensorDefinition(
types=(
MieleAppliance.WASHER_DRYER,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
),
description=MieleSensorDescription(
key="state_drying_step",
translation_key="drying_step",
value_fn=lambda value: StateDryingStep(
cast(int, value.state_drying_step)
).name,
entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorDeviceClass.ENUM,
options=sorted(StateDryingStep.keys()),
),
),
)

View File

@ -191,6 +191,19 @@
"energy_consumption": {
"name": "Energy consumption"
},
"drying_step": {
"name": "Drying step",
"state": {
"extra_dry": "Extra dry",
"hand_iron_1": "Hand iron 1",
"hand_iron_2": "Hand iron 2",
"machine_iron": "Machine iron",
"normal_plus": "Normal plus",
"normal": "Normal",
"slightly_dry": "Slightly dry",
"smoothing": "Smoothing"
}
},
"program_phase": {
"name": "Program phase",
"state": {