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
[mqtt.homie] build a per-thing thing type #15893
Conversation
Otherwise channel groups don't show up correctly in MainUI (in actual groups with a heading). Note that this is completely backwards compatible - even though Things change their ThingTypeUID after they're created, their UID does _not_ change, so no channel UIDs change either. A happy consequence of building ChannelDefinitions for the ThingType is that custom ChannelTypes are no longer necessary - the only variable parts are labels and state/command descriptions, which are overridden by the ThingType's ChannelDefinition and the DynamicStateDescriptionProvider respectively. This can greatly increase responsiveness of MainUI if you have many Homie things with many channels. My /rest/channel-types response went from 2.6MB to 175KB. Since the full list of thing types is never queried, there's no corresponding increase anywhere else. Signed-off-by: Cody Cutrer <cody@cutrer.us>
Build failed in tests. |
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Anything pending before this can be merged? |
ping @lolodomo. I know this is a large PR, but I've got additional commits waiting for this to merge, including a similar change for Home Assistant, and then on top of those two using AbstractStorageBasedTypeProvider so that both Homie and Home Assistant things don't have the two minute delay before going online after an openHAB restart. |
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. As i'm no Homie expert i can't fully asses the backwards compatibility. Before i merge this, can you confirm it is well tested and does not need a breaking change alert in the openhab-distro ?
Yes, I can confirm that this is fully backwards compatible. I've been running this for over a year in my production environment at this point, and two others for nearly 6 months. |
* [mqtt.homie] build a per-thing thing type Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homie] build a per-thing thing type Signed-off-by: Cody Cutrer <cody@cutrer.us> Signed-off-by: Alexander Drent <Alex@Drent-ict.nl>
Otherwise channel groups don't show up correctly in MainUI (in actual groups with a heading).
Note that this is completely backwards compatible - even though Things change their ThingTypeUID after they're created, their UID does not change, so no channel UIDs change either.
A happy consequence of building ChannelDefinitions for the ThingType is that custom ChannelTypes are no longer necessary - the only variable parts are labels and state/command descriptions, which are overridden by the ThingType's ChannelDefinition and the DynamicStateDescriptionProvider respectively. This can greatly increase responsiveness of MainUI if you have many Homie things with many channels. My /rest/channel-types response went from 2.6MB to 175KB. Since the full list of thing types is never queried, there's no corresponding increase anywhere else.
Fixes #9728, #11704