-
-
Notifications
You must be signed in to change notification settings - Fork 717
Improve modelling rules for light channels #2552
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@mherwege for info.. |
✅ Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
This seems to have failed the CI check due to reasons not related to the new/modified markdown content. |
@jlaur / @lolodomo you probably remember when I wrote the Hue API v2 binding we had some (heated) discussion about the OH "rules" governing what channels a light thing should and should not implement. Well in a recent discussion with @mherwege concerning the Web UI Location card I needed to refer to those rules. But it seems that they were never properly documented as such. There is a FAQ which partly and not very explicitly describes some suggestions. So I have reformulated this FAQ to make it more like rules and more explicit concerning implementation. Therefore please feel free to 1) comment on this PR, and 2) refer to it when you next review a light binding. |
LGTM |
@florian-h05 the CI build failed due to an npm error which I think is not related to my markdown text, but could you please check and let me know if I need to change something? |
I have retriggered CI, seems there was a temporary issue with the npm registry. |
0224dbd
to
5359d91
Compare
@florian-h05 many thanks. I have now fixed the lint errors. |
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.
Looks good to me, thanks!
Probably one of @openhab/add-ons-maintainers can also have a look.
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 for providing these rules in the docs. Some textual improvements.
Would it be possible to provide some core utility classes to make this easy for developers to adapt and/or contribute? It might be usefull to mention or provide a link to the helpers.
Maybe also add a not that brigtness channels like a display should not be tagged as they are not considered a light ?
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
What do you have in mind? Maybe conversion between color HSBType B part <=> Percentype brightness <=> OnOffType brightness != 0 ?? Or do you have something else in mind? Alternatively maybe a link to sample implementation ??
No. The tag combination |
Yes, an implementation example is really helpfull. I'm not that familiair to core helpers regarding color, but i guess developers face the same problems. Conversion helpers between individual channels and HSBType, with or without warm/cold white. I have to look at what you did for the zwavejs binding, it did envolve some logic that many developers are not immediate familiar with. |
…g/openhab-docs into lighting-modelling-rules
I understand that, but without that assumption, we can never restore the UI functionality as it was before. We do not have a way to distinguish a light from something else if we do not force it to be part of a LightSource Equipment. And we did not have that requirements before to simplify modelling. After all, forcing creation of an extra group item containing a single item looks ridiculous. And that's what was avoided before. One way around this could be to allow the LightSource Equipment tag to be added directly to the Point item if the Equipment is represented by a single point. But that is a much bigger change, not only in core, but in addons and very much so the UI. |
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@mherwege I suppose we could say that |
Yes, agree it feels clunky. But I don't see another easy solution. Allowing a combination of Equipment and Point tags on the same item feels clunky as well. It could solve the modelling issue, but is not easy to generate automatically from channel and thing definitions and has a whole lot of consequences throughout the code. |
Let's invite @openhab/add-ons-maintainers to share their thoughts. |
Apropos new helper methods in core .. I would add a link to this class and the |
I have been thinking about this some more. And I think we are over thinking the issue. Let us go back to basics:
|
What are your thoughts on the display (control+brightness) of example? How would that fit in those statements (1). I know it is easy to loose yourself with exemptions. |
It is a light. |
Can it be switched on and off as well? Is the binding code allowing the channel to be connected to a switch item? I would not consider this as a light, it is the dim level of a display. |
No. @mherwege my suggestion was to not lose sleep over such things; so what is your counter suggestion? |
@andrewfg My preference would be to remove the semantic tags on such a channel. Otherwise, the light badges will always show at least on light on in a room where this device is, and it will cost most people a lot of time to figure out where it comes from. Rather have them add it manually. I would reserve the light, brightness and color tags for use on real lights. This is just my opinion. |
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
All: let me know when you are done - I trust your reviews - I will then merge |
See discussion in openhab/openhab-webui#3325
See also openhab/openhab-webui#3344
Signed-off-by: Andrew Fiddian-Green software@whitebear.ch