Skip to content

Translate errors and warnings #40

Merged
dkarv merged 10 commits intomainfrom
feature/translated-errors
Feb 15, 2026
Merged

Translate errors and warnings #40
dkarv merged 10 commits intomainfrom
feature/translated-errors

Conversation

@dkarv
Copy link
Owner

@dkarv dkarv commented Feb 15, 2026

No description provided.

Copilot AI and others added 10 commits February 13, 2026 22:46
- Add translation keys for all error codes in strings.json, en.json, and de.json
- Modify ErrorSensor and WarningSensor to load and use translations
- Add extra_state_attributes with raw error codes for automation use
- Change separator from comma to comma+space for better readability

Co-authored-by: dkarv <3708591+dkarv@users.noreply.github.com>
Add FAQ section explaining how to use error codes in automations
Update entity table to clarify translated error messages and attribute access

Co-authored-by: dkarv <3708591+dkarv@users.noreply.github.com>
- Move _translate_error method from ErrorSensor and WarningSensor to BwtEntity
- Remove code duplication
- Remove trailing whitespace for better code style

Co-authored-by: dkarv <3708591+dkarv@users.noreply.github.com>
- Create TranslatableErrorMixin class for shared translation logic
- Rename _translate_error to _translate_code to reflect dual purpose
- Move async_added_to_hass translation loading to mixin
- Update ErrorSensor and WarningSensor to use the mixin
- Eliminates all code duplication between error and warning sensors

Co-authored-by: dkarv <3708591+dkarv@users.noreply.github.com>
- Add _get_errors() helper method to ErrorSensor
- Add _get_warnings() helper method to WarningSensor
- Remove extra blank line between classes
- Further reduce code duplication

Co-authored-by: dkarv <3708591+dkarv@users.noreply.github.com>
Add comprehensive docstring to TranslatableErrorMixin class explaining
its purpose and the _translations attribute lifecycle

Co-authored-by: dkarv <3708591+dkarv@users.noreply.github.com>
@dkarv dkarv merged commit cdc1c1f into main Feb 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants