Repository navigation
Conversation
|
All translations must be updated together. |
The status sensors are already SensorDeviceClass.ENUM with options, and the integration ships translations for config flow and issues, but the entity states themselves were never translated: the UI shows the raw option, e.g. B_STATUS_PRESERVE_CHARGE. The plain text existed only as a status_text attribute, which is not visible on the device page. Give both status sensors a translation key and add the entity state strings for en and de. English reuses the wording already in DEVICE_STATUS_TEXT and BATTERY_STATUS_TEXT so there is only one set of terms. The state value itself is unchanged, so automations comparing against B_STATUS_* keep working; only the displayed text changes. Other languages are left out on purpose rather than machine translated; they fall back to English.
b0960db to
567b0b9
Compare
Fills in fr, it, nb, nl and pl so all shipped translation files carry the status states, as requested in review: translations are updated together rather than one language at a time. English reuses the wording already in DEVICE_STATUS_TEXT and BATTERY_STATUS_TEXT. I can verify en, de and fr myself; it, nb, nl and pl are my best effort from the English terms, so corrections from native speakers are welcome for those four.
567b0b9 to
2279ba6
Compare
Done |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Proposed change
Both status sensors are already
SensorDeviceClass.ENUMwithoptions, and the integration ships translations for the config flow, options and repair issues. The entity states however are not translated, so the UI shows the raw option, for exampleB_STATUS_PRESERVE_CHARGEorI_STATUS_MPPT.The readable text already exists in the integration -
DEVICE_STATUS_TEXTandBATTERY_STATUS_TEXTare exposed as astatus_textattribute - but attributes are not shown on the device page, so what a user actually reads is the raw constant.This adds a
translation_keyto both status sensors and the correspondingentity.sensor.*.statesections, covering all 8 inverter and all 9 battery states.Updated for review: all seven shipped languages are now filled in together -
en,de,fr,it,nb,nl,pl. The first version only hadenandde; that was wrong for this project and is fixed.English reuses the existing wording from the two
*_TEXTtables so there is only one set of terms in the project. I can verifyen,deandfrmyself;it,nb,nlandplare my best effort from the English terms, so corrections from native speakers are welcome for those four.This is not a breaking change. The state value is untouched, only the displayed text changes, so automations and templates comparing against
B_STATUS_*orI_STATUS_*keep working.Testing
Tested on a running Home Assistant instance with an inverter and a battery.
Registry after the change:
Translations served by the frontend API:
Two things I checked explicitly because they were the risk:
B_STATUS_DISCHARGEandI_STATUS_MPPTthrough the API after the change.nameas a property.Rebased on the current main.
Checklist
Summary by CodeRabbit