Skip to content
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

[miele] Localization of state, program and phase #11603

Merged
merged 20 commits into from Nov 29, 2021

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Nov 18, 2021

Fixes #11602

Signed-off-by: Jacob Laursen jacob-github@vindvejr.dk

This pull request provides localization of state, program and phase texts. Please see linked issue for details.

Continuation of:

Primary enhancement

The XGW 3000 gateway supports English, German, French and Dutch, but with many limitations:

  • Most dishwasher texts are missing (all languages).
  • A lot of French texts are missing.
  • Some texts are provided, but actually of no use - for example "réservé (0x0004)" for washing machine program 4 (delicates) in French.

This pull request includes as many texts in these languages as possible (and additionally Danish texts) in order to avoid fallback to English in situations where gateway could have provided a localized text.

Texts provided by the binding are delivered in the configured openHAB system language, but can also be overridden in the bridge configuration.

The provided texts are not translated, but taken from one of these sources:

  • Response from the gateway when configured to target language.
  • Corresponding text from the Miele Cloud binding when configured to target language.
  • Text on appliance display when appliance is configured to target language.

In order to get a specific text, the appliance needs to be in the specific state or phase, so harvesting all texts is time consuming, and some texts are still lacking.

Related other changes

  • Bridge status messages are now internationalized and more specific.
  • LocalizedValue from gateway takes precedence over enum texts. Enum texts are always in English even when gateway is configured to some other language, so this resulted in English state texts.
  • Magic temperature value -32760 °C meaning "cold" is now interpreted as 10 °C.
  • Some missing strings for channel labels and descriptions have been added.

Additional changes

  • Configuration reload: Previously, after changing bridge configuration, bridge thing would change status to UNKNOWN and never recover from that. Probably it was never noticed because bridge configuration is quite static. However, after adding language configuration, this problem appeared quite quickly and consistently. This has been fixed.
  • Code duplication refactoring: Removed some duplicated code by extracting DeviceMetaData to separate file and implemented getMieleEnum here (previously implemented in each channel selector).

Fixes openhab#11602

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur changed the title [miele] Localization of for state, program and phase [miele] Localization of state, program and phase Nov 18, 2021
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur marked this pull request as ready for review November 21, 2021 12:40
@jlaur jlaur requested a review from kgoderis as a code owner November 21, 2021 12:41
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur
Copy link
Contributor Author

jlaur commented Nov 25, 2021

@kgoderis, @kaikreuzer - FYI, this PR is ready for review. It got kind of big, but finishes the work previously done in #11341 and #11423.

It would be nice for consideration in 3.2 as IMHO it more or less makes this binding feature complete. At least everything supported by the Miele@home cloud binding is now also supported by this binding, and all features I could find in the API's are supported. This concludes all the fixes and enhancements I intended to do for the Miele binding (and some more) - at least for now. :-)

@wborn wborn added enhancement An enhancement or new feature for an existing add-on translation labels Nov 27, 2021
@kaikreuzer kaikreuzer self-assigned this Nov 29, 2021
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, what a great work - thanks @jlaur for polishing this binding in all aspects!

@kaikreuzer kaikreuzer merged commit 33e751c into openhab:main Nov 29, 2021
@kaikreuzer kaikreuzer added this to the 3.2 milestone Nov 29, 2021
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Dec 30, 2021
* Initial changes for state, program and phase localization.
* Fix bridge configuration reload.
* Extracted DeviceMetaData from MieleBridgeHandler.
* Fix fallback to gateway text.
* Consolidate getMieleEnum in DeviceMetaData.
* Localize thing offline texts and increased accuracy.
* Validate language during bridge initialization.
* Interpret magic value for temperature.
* Add missing i18n channel label/description strings.
* Add missing washing machine phase texts in Dutch.
* Add missing French dishwasher phase texts.

Fixes openhab#11602

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
mischmidt83 pushed a commit to mischmidt83/openhab-addons that referenced this pull request Jan 9, 2022
* Initial changes for state, program and phase localization.
* Fix bridge configuration reload.
* Extracted DeviceMetaData from MieleBridgeHandler.
* Fix fallback to gateway text.
* Consolidate getMieleEnum in DeviceMetaData.
* Localize thing offline texts and increased accuracy.
* Validate language during bridge initialization.
* Interpret magic value for temperature.
* Add missing i18n channel label/description strings.
* Add missing washing machine phase texts in Dutch.
* Add missing French dishwasher phase texts.

Fixes openhab#11602

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
* Initial changes for state, program and phase localization.
* Fix bridge configuration reload.
* Extracted DeviceMetaData from MieleBridgeHandler.
* Fix fallback to gateway text.
* Consolidate getMieleEnum in DeviceMetaData.
* Localize thing offline texts and increased accuracy.
* Validate language during bridge initialization.
* Interpret magic value for temperature.
* Add missing i18n channel label/description strings.
* Add missing washing machine phase texts in Dutch.
* Add missing French dishwasher phase texts.

Fixes openhab#11602

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
volkmarnissen pushed a commit to volkmarnissen/openhab-addons that referenced this pull request Mar 3, 2022
* Initial changes for state, program and phase localization.
* Fix bridge configuration reload.
* Extracted DeviceMetaData from MieleBridgeHandler.
* Fix fallback to gateway text.
* Consolidate getMieleEnum in DeviceMetaData.
* Localize thing offline texts and increased accuracy.
* Validate language during bridge initialization.
* Interpret magic value for temperature.
* Add missing i18n channel label/description strings.
* Add missing washing machine phase texts in Dutch.
* Add missing French dishwasher phase texts.

Fixes openhab#11602

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* Initial changes for state, program and phase localization.
* Fix bridge configuration reload.
* Extracted DeviceMetaData from MieleBridgeHandler.
* Fix fallback to gateway text.
* Consolidate getMieleEnum in DeviceMetaData.
* Localize thing offline texts and increased accuracy.
* Validate language during bridge initialization.
* Interpret magic value for temperature.
* Add missing i18n channel label/description strings.
* Add missing washing machine phase texts in Dutch.
* Add missing French dishwasher phase texts.

Fixes openhab#11602

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Initial changes for state, program and phase localization.
* Fix bridge configuration reload.
* Extracted DeviceMetaData from MieleBridgeHandler.
* Fix fallback to gateway text.
* Consolidate getMieleEnum in DeviceMetaData.
* Localize thing offline texts and increased accuracy.
* Validate language during bridge initialization.
* Interpret magic value for temperature.
* Add missing i18n channel label/description strings.
* Add missing washing machine phase texts in Dutch.
* Add missing French dishwasher phase texts.

Fixes openhab#11602

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[miele] Localization of states, programs and phases
3 participants