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.
This commit is contained in:
Marc Billow
2026-08-15 02:44:01 +00:00
parent bc21f5f8f5
commit a59ef6cca9
8 changed files with 39 additions and 8 deletions
@@ -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",
@@ -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"
@@ -952,7 +952,10 @@
"name": "Trockenzeit"
},
"dryer_type": {
"name": "Trocknertyp"
"name": "Trocknertyp",
"state": {
"electricity": "Strom"
}
},
"dust": {
"name": "Staub"
@@ -958,7 +958,10 @@
"name": "Dry time"
},
"dryer_type": {
"name": "Dryer type"
"name": "Dryer type",
"state": {
"electricity": "Electricity"
}
},
"dust": {
"name": "Dust"
@@ -1151,7 +1151,10 @@
"name": "Tiempo de secado"
},
"dryer_type": {
"name": "Tipo de secadora"
"name": "Tipo de secadora",
"state": {
"electricity": "Electricidad"
}
},
"dust": {
"name": "Polvo"
@@ -958,7 +958,10 @@
"name": "Tempo di asciugatura"
},
"dryer_type": {
"name": "Tipo di asciugatrice"
"name": "Tipo di asciugatrice",
"state": {
"electricity": "Elettricità"
}
},
"dust": {
"name": "Polvere"
@@ -958,7 +958,10 @@
"name": "건조 시간"
},
"dryer_type": {
"name": "건조기 유형"
"name": "건조기 유형",
"state": {
"electricity": "전기"
}
},
"dust": {
"name": "미세먼지"
@@ -958,7 +958,10 @@
"name": "Droogtijd"
},
"dryer_type": {
"name": "Type droger"
"name": "Type droger",
"state": {
"electricity": "Elektriciteit"
}
},
"dust": {
"name": "Stof"