Keep the drum-clean unit in code rather than the catalog
Home Assistant resolves a catalog `unit_of_measurement` against the default language, not the user's (entity_platform re-fetches 'en' for exactly this key), because a unit is part of the state's identity -- the recorder writes it into statistics metadata and compares it across restarts. Localizing it would make switching Home Assistant's language look like a unit change and suppress the sensor's statistics. So the six non-English entries were never read, and the English one only restated what `unit="cycles"` already said. Same displayed unit either way; this drops seven catalog keys that looked translatable but weren't.
This commit is contained in:
9 files changed
+9
-14
No files matched your search
@@ -70,6 +70,7 @@ DRYER_COURSE = Capability(
|
|||||||
),
|
),
|
||||||
SensorDesc(
|
SensorDesc(
|
||||||
key="drum_clean_cycles_remaining",
|
key="drum_clean_cycles_remaining",
|
||||||
|
unit="cycles",
|
||||||
icon="mdi:tumble-dryer-alert",
|
icon="mdi:tumble-dryer-alert",
|
||||||
state_class="measurement",
|
state_class="measurement",
|
||||||
exists_fn=lambda rep, resources: drum_clean_cycles_remaining(rep) is not None,
|
exists_fn=lambda rep, resources: drum_clean_cycles_remaining(rep) is not None,
|
||||||
|
|||||||
@@ -275,6 +275,7 @@ WASHER_COURSE = Capability(
|
|||||||
),
|
),
|
||||||
SensorDesc(
|
SensorDesc(
|
||||||
key="drum_clean_cycles_remaining",
|
key="drum_clean_cycles_remaining",
|
||||||
|
unit="cycles",
|
||||||
icon="mdi:washing-machine-alert",
|
icon="mdi:washing-machine-alert",
|
||||||
state_class="measurement",
|
state_class="measurement",
|
||||||
exists_fn=lambda rep, resources: drum_clean_cycles_remaining(rep) is not None,
|
exists_fn=lambda rep, resources: drum_clean_cycles_remaining(rep) is not None,
|
||||||
|
|||||||
@@ -946,8 +946,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drum_clean_cycles_remaining": {
|
"drum_clean_cycles_remaining": {
|
||||||
"name": "Čištění bubnu za",
|
"name": "Čištění bubnu za"
|
||||||
"unit_of_measurement": "cyklů"
|
|
||||||
},
|
},
|
||||||
"drum_clean_last_cleaned": {
|
"drum_clean_last_cleaned": {
|
||||||
"name": "Poslední čištění bubnu"
|
"name": "Poslední čištění bubnu"
|
||||||
|
|||||||
@@ -940,8 +940,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drum_clean_cycles_remaining": {
|
"drum_clean_cycles_remaining": {
|
||||||
"name": "Trommelreinigung fällig in",
|
"name": "Trommelreinigung fällig in"
|
||||||
"unit_of_measurement": "Zyklen"
|
|
||||||
},
|
},
|
||||||
"drum_clean_last_cleaned": {
|
"drum_clean_last_cleaned": {
|
||||||
"name": "Trommel zuletzt gereinigt"
|
"name": "Trommel zuletzt gereinigt"
|
||||||
|
|||||||
@@ -946,8 +946,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drum_clean_cycles_remaining": {
|
"drum_clean_cycles_remaining": {
|
||||||
"name": "Drum clean due in",
|
"name": "Drum clean due in"
|
||||||
"unit_of_measurement": "cycles"
|
|
||||||
},
|
},
|
||||||
"drum_clean_last_cleaned": {
|
"drum_clean_last_cleaned": {
|
||||||
"name": "Drum last cleaned"
|
"name": "Drum last cleaned"
|
||||||
|
|||||||
@@ -1139,8 +1139,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drum_clean_cycles_remaining": {
|
"drum_clean_cycles_remaining": {
|
||||||
"name": "Limpieza de tambor en",
|
"name": "Limpieza de tambor en"
|
||||||
"unit_of_measurement": "ciclos"
|
|
||||||
},
|
},
|
||||||
"drum_clean_last_cleaned": {
|
"drum_clean_last_cleaned": {
|
||||||
"name": "Última limpieza del tambor"
|
"name": "Última limpieza del tambor"
|
||||||
|
|||||||
@@ -946,8 +946,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drum_clean_cycles_remaining": {
|
"drum_clean_cycles_remaining": {
|
||||||
"name": "Pulizia cestello fra",
|
"name": "Pulizia cestello fra"
|
||||||
"unit_of_measurement": "cicli"
|
|
||||||
},
|
},
|
||||||
"drum_clean_last_cleaned": {
|
"drum_clean_last_cleaned": {
|
||||||
"name": "Ultima pulizia cestello"
|
"name": "Ultima pulizia cestello"
|
||||||
|
|||||||
@@ -946,8 +946,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drum_clean_cycles_remaining": {
|
"drum_clean_cycles_remaining": {
|
||||||
"name": "통세척까지 남은 횟수",
|
"name": "통세척까지 남은 횟수"
|
||||||
"unit_of_measurement": "회"
|
|
||||||
},
|
},
|
||||||
"drum_clean_last_cleaned": {
|
"drum_clean_last_cleaned": {
|
||||||
"name": "마지막 통세척"
|
"name": "마지막 통세척"
|
||||||
|
|||||||
@@ -946,8 +946,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drum_clean_cycles_remaining": {
|
"drum_clean_cycles_remaining": {
|
||||||
"name": "Trommelreiniging over",
|
"name": "Trommelreiniging over"
|
||||||
"unit_of_measurement": "cycli"
|
|
||||||
},
|
},
|
||||||
"drum_clean_last_cleaned": {
|
"drum_clean_last_cleaned": {
|
||||||
"name": "Trommel laatst gereinigd"
|
"name": "Trommel laatst gereinigd"
|
||||||
|
|||||||
Reference in new issue
Block a user