-
Notifications
You must be signed in to change notification settings - Fork 8
Add translation support for the new HAError raise message #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpdated the Plugwise climate error to use an i18n translation key/domain when raising HomeAssistantError; replaced the literal ERROR_NO_SCHEDULE message with the key Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HA as HomeAssistant
participant Climate as plugwise.climate
User->>HA: set HVAC mode → AUTO
HA->>Climate: async_set_hvac_mode(AUTO)
alt schedule exists
Climate->>Climate: apply schedule/mode
Climate-->>HA: success
HA-->>User: confirm
else no schedule
Climate-->>HA: raise HomeAssistantError(translation_domain=DOMAIN, translation_key="set_schedule_first")
HA-->>User: display localized error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
custom_components/plugwise/climate.py(2 hunks)custom_components/plugwise/strings.json(1 hunks)custom_components/plugwise/translations/en.json(1 hunks)custom_components/plugwise/translations/nl.json(3 hunks)
🔇 Additional comments (6)
custom_components/plugwise/translations/nl.json (2)
21-27: LGTM - Reconfigure step added.The reconfigure configuration step is properly structured with description and data fields for host and port.
52-54: LGTM - Abort messages added.The abort messages follow Home Assistant conventions and provide clear feedback for reconfiguration scenarios.
custom_components/plugwise/translations/en.json (1)
304-306: LGTM - English translation added correctly.The
set_schedule_firstexception translation is properly structured and provides a clear error message.custom_components/plugwise/strings.json (1)
321-323: LGTM - Base exception string defined correctly.The
set_schedule_firstexception is properly defined in the base strings file with a clear, actionable message.custom_components/plugwise/climate.py (2)
57-57: LGTM - Constant updated to translation key.The
ERROR_NO_SCHEDULEconstant is correctly updated from a hardcoded message to a translation key, enabling internationalization.
334-337: LGTM - Proper translation-based error handling.The error is now raised using Home Assistant's translation mechanism with
translation_domainandtranslation_key, which correctly references the translation strings defined in strings.json and translation files.
7022fb7 to
8f163f2
Compare
8f163f2 to
cbd51e7
Compare
|



Also, add several missing NL-translations.
Summary by CodeRabbit