-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Meteoalerte] Add an IconProvider #14811
Conversation
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Looking at the captures, it looks like you used a grey as fill color. It will lead to very poor contrast in dark mode. Providing colored icons based on the item state is certainly adapted in that case. |
But this is apparently not the way you did it. |
You do not use AbstractResourceIconProvider? |
...lerte/src/main/java/org/openhab/binding/meteoalerte/internal/handler/MeteoAlerteHandler.java
Outdated
Show resolved
Hide resolved
...teoalerte/src/main/java/org/openhab/binding/meteoalerte/internal/MeteoAlertIconProvider.java
Outdated
Show resolved
Hide resolved
...lerte/src/main/java/org/openhab/binding/meteoalerte/internal/handler/MeteoAlerteHandler.java
Outdated
Show resolved
Hide resolved
...teoalerte/src/main/java/org/openhab/binding/meteoalerte/internal/MeteoAlertIconProvider.java
Outdated
Show resolved
Hide resolved
...teoalerte/src/main/java/org/openhab/binding/meteoalerte/internal/MeteoAlertIconProvider.java
Outdated
Show resolved
Hide resolved
...teoalerte/src/main/java/org/openhab/binding/meteoalerte/internal/MeteoAlertIconProvider.java
Outdated
Show resolved
Hide resolved
<channel id="avalanches" typeId="alert-level"> | ||
<label>Etat Avalanches</label> | ||
</channel> | ||
<channel id="vague-submersion" typeId="vague-submersion"/> |
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.
Migration instructions would be appreciated as you changed all thing types.
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.
Done
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.
I neutralized the update instructions currently because I'm facing the same error than reported here.
bundles/org.openhab.binding.meteoalerte/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.meteoalerte/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.meteoalerte/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
I have tested in black theme and white theme. The gray icon does the job. |
I'm going to push an update with many of your observations addressed but I still have some cleansing to do. |
Signed-off-by: clinique <[email protected]>
…he binding. Will investigate. Signed-off-by: clinique <[email protected]>
I really like the idea to provide default icon for very specific channels when there is no adapted icon already present in the classic icon set. |
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Remove hyphen replacement by underscores. Signed-off-by: clinique <[email protected]>
...teoalerte/src/main/java/org/openhab/binding/meteoalerte/internal/MeteoAlertIconProvider.java
Outdated
Show resolved
Hide resolved
...teoalerte/src/main/java/org/openhab/binding/meteoalerte/internal/MeteoAlertIconProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: clinique <[email protected]>
Ok, we have now only 3 opened comments:
|
You're correct, now that the iconset is filtered on the binding_id it makes fully sense.
Yes, as soon as it is renamed to "xml", the launch in eclipse fails and I'm not able to test. Apparently this happens only with eclipse due to a "sombre histoire de dépendances". I'll rename it, you'll tell me if you experiment the same.
Sure I did it but can not find it neither. I'm experiencing issues with dying eclipse since I updated to Ubuntu 23.04 so mixing between eclipse and vscode. It's tough today. |
I changed to colors according to this template : I tried using the colors proposed by OpenUV but I see them not being flashy enough. |
Signed-off-by: clinique <[email protected]>
I will wait for the merge of openhab/openhab-webui#1849 first. |
Thing migration tested (for the first time for me) and the results are mixed.
@J-N-K (as our expert in thing migration): is all this normal? Finally the thing in userdata/jsondb/org.openhab.core.thing.Thing.json looks updated with the new channel types UID. But icons are not displayed in MainUI ! And something very important and certainly a bug, "itemType" is now missing for the migrated channels. MainUI considers switch as default. If I restart the bundle, I still have first the NOT_YET_READY status:
Icons still not displayed in MainUI. If I restart OH, still no icon displayed in MainUI. As a temporary conclusion, the thing migration seems to be partially OK but |
Channel after migration:
And the same channel for a newly created thing using MainUI:
Label and description fields are also missing after the migration. |
Orange is good now I believe. |
Current status: only remaining one problem with the channels migration. |
@clinique : with openhab/openhab-core#3576 the migration is now working well. The only problem is that if you had a channel linked to an item (so without category), the item will not inherit your new channel category after migration: I will merge this PR as soon as openhab/openhab-core#3576 and openhab/openhab-webui#1849 are merged. |
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.
LGTM, thank you
Just one thing: it would be cool if you could add a "Icon" chapter in the documentation, to list all the available icons provided by the binding. |
I'll put that on my todo list. |
openhab/openhab-webui#1849 is now merged. |
Core PR has just been merged. @clinique : do I wait for an improvement of the documentation (listing all available icons) ? |
Signed-off-by: clinique <[email protected]>
@lolodomo : done |
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.
Thank you @clinique , just two remarks.
Signed-off-by: clinique <[email protected]>
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.
LGTM, thank you Gael
* Solving activation / deactivation of IT4Wifi thing glitches. * Some code enhancements * Addition of an IconProvider --------- Signed-off-by: clinique <[email protected]> Signed-off-by: Thomas Burri <[email protected]>
* Solving activation / deactivation of IT4Wifi thing glitches. * Some code enhancements * Addition of an IconProvider --------- Signed-off-by: clinique <[email protected]> Signed-off-by: Matt Myers <[email protected]>
* Solving activation / deactivation of IT4Wifi thing glitches. * Some code enhancements * Addition of an IconProvider --------- Signed-off-by: clinique <[email protected]> Signed-off-by: Jørgen Austvik <[email protected]>
This PR adds an icon provider to MeteoAlerte binding so svg icon of weather alert are served by the binding.
Served icons are also dynamically colored based on the alert level.