Conversation
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>
There was a problem hiding this comment.
Pull request overview
This pull request inlines I18N text references from the properties file directly into XML configuration files for the Shelly binding. The changes replace @text/ reference patterns with the actual text values from shelly.properties, making the XML files self-contained and eliminating the need for external text lookups.
Changes:
- Inlined all I18N text references in thing definition XML files (device descriptions, labels, channel types)
- Inlined I18N references in configuration XML files (parameter labels and descriptions)
- Reorganized and expanded the shelly.properties file to include all previously referenced keys
- Applied automated script to perform text replacements consistently across multiple files
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| unknown.xml | Inlined device and configuration descriptions for unknown/protected devices |
| shellyGen2_sensor.xml | Inlined descriptions for Gen2 sensor devices |
| shellyGen2_relay.xml | Inlined descriptions and labels for Gen2 relay devices with extensive channel groups |
| shellyGen2_lights.xml | Inlined descriptions for Gen2 LED controllers |
| shellyGen1_sensor.xml | Inlined extensive channel type definitions and state options for Gen1 sensors |
| shellyGen1_relay.xml | Inlined channel types and state options for Gen1 relay devices |
| shellyGen1_lights.xml | Inlined light control descriptions and color effect options |
| shellyBlu.xml | Inlined descriptions for Bluetooth device types |
| device.xml | Inlined device status channel types and alarm options |
| configblu.xml | Inlined configuration parameter labels/descriptions for BLU devices |
| config2.xml | Inlined configuration parameters for Gen2 devices |
| config.xml | Inlined configuration parameters for Gen1 devices |
| addon.xml | Inlined addon configuration descriptions |
| shelly.properties | Reorganized with new sections and added all previously referenced keys |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_sensor.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyBlu.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/config/configblu.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/config/config2.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/config/config.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_sensor.xml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Having the commits reflecting the steps taken is very review friendly, thanks for doing it thisway.
As this was mainly script drivven, I did not review and investigate every single line, but did like 20 tests and no errors are found. I'm confident this is another step forward in getting this binding to a stable situation.
Copilot did some suggestions that should be fixed, otherwise LGTM
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
92a4f93 to
ca6e2df
Compare
|
Regarding the "treshold" typo found by Copilot: It also appears in DTO's: The last one doesn't matter, but for the first two, the question is: Does the Shelly API have the same typo, or are these thresholds broken in the binding? FYI @markus7017 |
It doesn't appear so from documentation, but I don't have any Gen 1 devices to verify if implementation is according to the documentation: https://shelly-api-docs.shelly.cloud/gen1/#shelly-motion-settings
EDIT: Fixed in #20087 |
Follow-up to #19586 (comment)
Please see individual commits for the steps taken. I don't know if there's already a tool for it, but I quite quickly got decent results from an AI-generated script for the "inlining" commit (and detecting the wrong keys for the first commit) - see below.
Also fixes:
@text/references were invalid (pointing to non-existing I18N keys).&Tshould not appear in shelly.properties, only in XML.channel-type.shelly.motionActive.descriptionwas lost in Fix documentation, grammar, and spelling in bindings Q-S #19586.