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

[hdpowerview] Optimize initialization of shades #12113

Merged
merged 2 commits into from
Jan 28, 2022

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Jan 24, 2022

Fixes #12071 - please see this issue for further details.

Signed-off-by: Jacob Laursen [email protected]

This pull request fixes a concurrency issue and optimizes the status transitions for shades to come online as fast as possible:

  • A five second initial delay in requesting shade data has been removed. It probably existed because of next problem:
  • Bridge could receive data before shade things were initialized. This would cause them to come ONLINE prematurely, thus go back to UNKNOWN when being initialized. After this there would be a one minute delay in coming ONLINE again after next data poll.

Example of transitions for a single shade after the changes:

2022-01-24 23:28:01.835 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hdpowerview:shade:hub:blind11' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2022-01-24 23:28:01.847 [DEBUG] [rnal.handler.HDPowerViewShadeHandler] - Initializing shade handler for shade 36321
2022-01-24 23:28:01.873 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hdpowerview:shade:hub:blind11' changed from INITIALIZING to UNKNOWN
2022-01-24 23:28:02.010 [DEBUG] [ternal.handler.HDPowerViewHubHandler] - Child handler initialized: hdpowerview:shade:hub:blind11
2022-01-24 23:28:02.026 [DEBUG] [ternal.handler.HDPowerViewHubHandler] - Updating shade '36321'
2022-01-24 23:28:02.029 [DEBUG] [rnal.handler.HDPowerViewShadeHandler] - Caching capabilities 7 for shade 36321
2022-01-24 23:28:02.206 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hdpowerview:shade:hub:blind11' changed from UNKNOWN to ONLINE

Planned for next PR in this area:

  • Implement handling of shade removal, i.e. deletion of a shade in the PowerView Hub.

@jlaur jlaur added enhancement An enhancement or new feature for an existing add-on work in progress A PR that is not yet ready to be merged labels Jan 24, 2022
@jlaur jlaur marked this pull request as ready for review January 24, 2022 23:13
@jlaur jlaur removed the work in progress A PR that is not yet ready to be merged label Jan 24, 2022
@jlaur jlaur force-pushed the 12071-hdpowerview-shade-initialization branch from 7461ee1 to d2e5bf3 Compare January 25, 2022 19:12
@jlaur jlaur requested a review from a team January 27, 2022 05:47
@jlaur
Copy link
Contributor Author

jlaur commented Jan 27, 2022

@fwolter - sorry to exploit you a little, but #12061 (comment) seems to suggest that these channel state changes is your ball game, so maybe you could also have a look at this one now that we're at it? :-)

@jlaur jlaur requested a review from fwolter January 27, 2022 21:29
@jlaur jlaur force-pushed the 12071-hdpowerview-shade-initialization branch from d2e5bf3 to d0b53e8 Compare January 27, 2022 22:08
@fwolter fwolter merged commit dab48dd into openhab:main Jan 28, 2022
@wborn wborn added this to the 3.3 milestone Feb 13, 2022
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Apr 27, 2022
* Optimize initialization of shades.

Fixes openhab#12071

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid hashmap reallocation during initialization.

Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Nick Waterton <[email protected]>
@jlaur jlaur deleted the 12071-hdpowerview-shade-initialization branch June 13, 2022 18:33
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jun 29, 2022
* Optimize initialization of shades.

Fixes openhab#12071

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid hashmap reallocation during initialization.

Signed-off-by: Jacob Laursen <[email protected]>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Optimize initialization of shades.

Fixes openhab#12071

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid hashmap reallocation during initialization.

Signed-off-by: Jacob Laursen <[email protected]>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* Optimize initialization of shades.

Fixes openhab#12071

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid hashmap reallocation during initialization.

Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Andras Uhrin <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[hdpowerview] Timing dependency during initialization of shades
4 participants