Translate inverter and battery status states - #1037
Open
it-rec wants to merge 2 commits into
Open
Conversation
Owner
|
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.
it-rec
force-pushed
the
feat/status-state-translations
branch
from
August 17, 2026 05:11
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.
it-rec
force-pushed
the
feat/status-state-translations
branch
from
August 17, 2026 06:01
567b0b9 to
2279ba6
Compare
Author
Done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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