From a59ef6cca94457287523931cebf2500eb358e5e9 Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Sat, 15 Aug 2026 02:44:01 +0000 Subject: [PATCH 1/2] dryer: translate dryer_type, folding in #366's Dutch additions #366 added Dutch state translations for dryer_type ('Electricity') and progress, but predates #371's lowercase-key normalization: its progress states were already superseded (every one it added is already in nl.json's current 'state' table, lowercase), and its dryer_type addition used the pre-#371 capitalized key. dryer_type itself was never wired for translation at all -- no device_class, no options -- so nothing in any locale's dryer_type.state table was ever read. Give it device_class=enum, options=("electricity",) (the only value confirmed across shipped fixtures), and the same value_fn=lower() normalization #371 used elsewhere, then add the 'electricity' state across all seven locale catalogs, not just Dutch. --- .../localthings/registry/capabilities/dryer.py | 12 +++++++++++- custom_components/localthings/translations/cs.json | 5 ++++- custom_components/localthings/translations/de.json | 5 ++++- custom_components/localthings/translations/en.json | 5 ++++- custom_components/localthings/translations/es.json | 5 ++++- custom_components/localthings/translations/it.json | 5 ++++- custom_components/localthings/translations/ko.json | 5 ++++- custom_components/localthings/translations/nl.json | 5 ++++- 8 files changed, 39 insertions(+), 8 deletions(-) diff --git a/custom_components/localthings/registry/capabilities/dryer.py b/custom_components/localthings/registry/capabilities/dryer.py index f4d7b51..7f02b8d 100644 --- a/custom_components/localthings/registry/capabilities/dryer.py +++ b/custom_components/localthings/registry/capabilities/dryer.py @@ -27,7 +27,17 @@ DRYER_SETTINGS = Capability( entities=( SensorDesc(key="dry_level", field="x.com.samsung.da.dryLevel", icon="mdi:water-percent"), SensorDesc(key="dry_time", field="x.com.samsung.da.dryTime", icon="mdi:timer"), - SensorDesc(key="dryer_type", field="x.com.samsung.da.dryerType", icon="mdi:tumble-dryer"), + SensorDesc( + key="dryer_type", + field="x.com.samsung.da.dryerType", + icon="mdi:tumble-dryer", + device_class="enum", + # Only 'Electricity' confirmed across shipped fixtures (#366); an + # unrecognized value still passes through raw via sensor.py's + # options property rather than breaking the entity. + options=("electricity",), + value_fn=lambda v: v.lower() if isinstance(v, str) else v, + ), SwitchDesc( key="wrinkle_prevent", field="x.com.samsung.da.wrinklePrevent", diff --git a/custom_components/localthings/translations/cs.json b/custom_components/localthings/translations/cs.json index 8af70be..c929888 100644 --- a/custom_components/localthings/translations/cs.json +++ b/custom_components/localthings/translations/cs.json @@ -958,7 +958,10 @@ "name": "Doba sušení" }, "dryer_type": { - "name": "Typ sušičky" + "name": "Typ sušičky", + "state": { + "electricity": "Elektřina" + } }, "dust": { "name": "Prach" diff --git a/custom_components/localthings/translations/de.json b/custom_components/localthings/translations/de.json index 9e54ce5..8229aef 100644 --- a/custom_components/localthings/translations/de.json +++ b/custom_components/localthings/translations/de.json @@ -952,7 +952,10 @@ "name": "Trockenzeit" }, "dryer_type": { - "name": "Trocknertyp" + "name": "Trocknertyp", + "state": { + "electricity": "Strom" + } }, "dust": { "name": "Staub" diff --git a/custom_components/localthings/translations/en.json b/custom_components/localthings/translations/en.json index 98d21b1..fb2ec6b 100644 --- a/custom_components/localthings/translations/en.json +++ b/custom_components/localthings/translations/en.json @@ -958,7 +958,10 @@ "name": "Dry time" }, "dryer_type": { - "name": "Dryer type" + "name": "Dryer type", + "state": { + "electricity": "Electricity" + } }, "dust": { "name": "Dust" diff --git a/custom_components/localthings/translations/es.json b/custom_components/localthings/translations/es.json index 399fbb2..29a6338 100644 --- a/custom_components/localthings/translations/es.json +++ b/custom_components/localthings/translations/es.json @@ -1151,7 +1151,10 @@ "name": "Tiempo de secado" }, "dryer_type": { - "name": "Tipo de secadora" + "name": "Tipo de secadora", + "state": { + "electricity": "Electricidad" + } }, "dust": { "name": "Polvo" diff --git a/custom_components/localthings/translations/it.json b/custom_components/localthings/translations/it.json index 8bcbd6b..605fa0b 100644 --- a/custom_components/localthings/translations/it.json +++ b/custom_components/localthings/translations/it.json @@ -958,7 +958,10 @@ "name": "Tempo di asciugatura" }, "dryer_type": { - "name": "Tipo di asciugatrice" + "name": "Tipo di asciugatrice", + "state": { + "electricity": "Elettricità" + } }, "dust": { "name": "Polvere" diff --git a/custom_components/localthings/translations/ko.json b/custom_components/localthings/translations/ko.json index aab7879..fb4c452 100644 --- a/custom_components/localthings/translations/ko.json +++ b/custom_components/localthings/translations/ko.json @@ -958,7 +958,10 @@ "name": "건조 시간" }, "dryer_type": { - "name": "건조기 유형" + "name": "건조기 유형", + "state": { + "electricity": "전기" + } }, "dust": { "name": "미세먼지" diff --git a/custom_components/localthings/translations/nl.json b/custom_components/localthings/translations/nl.json index ec45195..5e64766 100644 --- a/custom_components/localthings/translations/nl.json +++ b/custom_components/localthings/translations/nl.json @@ -958,7 +958,10 @@ "name": "Droogtijd" }, "dryer_type": { - "name": "Type droger" + "name": "Type droger", + "state": { + "electricity": "Elektriciteit" + } }, "dust": { "name": "Stof" From 76f2c3c0cd493ac7ec31fba1748a1c5907dcb26c Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Sat, 15 Aug 2026 02:56:50 +0000 Subject: [PATCH 2/2] progress: add dryingwithdooropen ('Venting') across all locales Confirmed on a live dishwasher's sensor.*_progress history (not in any shipped fixture): Prewash -> Wash -> Rinse -> Drying -> DryingWithDoorOpen -> Finish -> Idle. The door-open drying-assist stage had no catalog entry, so it fell through to the sensor.py fallback and rendered as the raw lowercased string 'dryingwithdooropen' instead of a readable name. No code change needed -- operational.py's progress SensorDesc already derives its options from the catalog via translated_states(), so a new state key is picked up automatically. --- custom_components/localthings/translations/cs.json | 1 + custom_components/localthings/translations/de.json | 1 + custom_components/localthings/translations/en.json | 1 + custom_components/localthings/translations/es.json | 1 + custom_components/localthings/translations/it.json | 1 + custom_components/localthings/translations/ko.json | 1 + custom_components/localthings/translations/nl.json | 1 + 7 files changed, 7 insertions(+) diff --git a/custom_components/localthings/translations/cs.json b/custom_components/localthings/translations/cs.json index c929888..b20383a 100644 --- a/custom_components/localthings/translations/cs.json +++ b/custom_components/localthings/translations/cs.json @@ -1101,6 +1101,7 @@ "steaming": "Napařování", "airwashing": "Osvěžení vzduchem", "drying": "Sušení", + "dryingwithdooropen": "Větrání", "cooling": "Chlazení", "predrain": "Vypouštění", "prewash": "Předpírka" diff --git a/custom_components/localthings/translations/de.json b/custom_components/localthings/translations/de.json index 8229aef..1fcaee4 100644 --- a/custom_components/localthings/translations/de.json +++ b/custom_components/localthings/translations/de.json @@ -1095,6 +1095,7 @@ "steaming": "Dämpfen", "airwashing": "Luftreinigung", "drying": "Trocknen", + "dryingwithdooropen": "Lüften", "cooling": "Abkühlen", "predrain": "Abpumpen", "prewash": "Vorwäsche" diff --git a/custom_components/localthings/translations/en.json b/custom_components/localthings/translations/en.json index fb2ec6b..769cdf8 100644 --- a/custom_components/localthings/translations/en.json +++ b/custom_components/localthings/translations/en.json @@ -1101,6 +1101,7 @@ "steaming": "Steaming", "airwashing": "Air washing", "drying": "Drying", + "dryingwithdooropen": "Venting", "cooling": "Cooling", "predrain": "Pre-drain", "prewash": "Pre-wash" diff --git a/custom_components/localthings/translations/es.json b/custom_components/localthings/translations/es.json index 29a6338..8a418a0 100644 --- a/custom_components/localthings/translations/es.json +++ b/custom_components/localthings/translations/es.json @@ -1294,6 +1294,7 @@ "steaming": "Vaporización", "airwashing": "Lavado con aire", "drying": "Secado", + "dryingwithdooropen": "Ventilación", "cooling": "Enfriamiento", "predrain": "Drenaje previo", "prewash": "Prelavado" diff --git a/custom_components/localthings/translations/it.json b/custom_components/localthings/translations/it.json index 605fa0b..456a6c0 100644 --- a/custom_components/localthings/translations/it.json +++ b/custom_components/localthings/translations/it.json @@ -1101,6 +1101,7 @@ "steaming": "Vapore", "airwashing": "Lavaggio ad aria", "drying": "Asciugatura", + "dryingwithdooropen": "Ventilazione", "cooling": "Raffreddamento", "predrain": "Scarico preliminare", "prewash": "Prelavaggio" diff --git a/custom_components/localthings/translations/ko.json b/custom_components/localthings/translations/ko.json index fb4c452..164437f 100644 --- a/custom_components/localthings/translations/ko.json +++ b/custom_components/localthings/translations/ko.json @@ -1101,6 +1101,7 @@ "steaming": "스팀", "airwashing": "에어워시", "drying": "건조", + "dryingwithdooropen": "환기", "cooling": "냉각", "predrain": "사전 배수", "prewash": "애벌빨래" diff --git a/custom_components/localthings/translations/nl.json b/custom_components/localthings/translations/nl.json index 5e64766..81b57c4 100644 --- a/custom_components/localthings/translations/nl.json +++ b/custom_components/localthings/translations/nl.json @@ -1101,6 +1101,7 @@ "steaming": "Stomen", "airwashing": "Luchtreiniging", "drying": "Drogen", + "dryingwithdooropen": "Ventileren", "cooling": "Koelen", "predrain": "Vooraf afpompen", "prewash": "Voorwas"