-
Notifications
You must be signed in to change notification settings - Fork 131
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
Detect non ha changes | wait for transitions | performance improvements #486
Detect non ha changes | wait for transitions | performance improvements #486
Conversation
todo in later commit: move array to TurnOnOffListener.
Slow and steady wins the race. Having a local testing environment was substantial for development and cut the testing time down by 90%. Tested on my own system and works great :). @basnijholt this PR is ready for review. |
@nathang21 this is ready! |
I'm satisfied with this PR, everything is very efficient now. I've been forced to use an interval of 90 or else my zigbee network would go completely out of whack as the update_entity spam was just too much. Now Adaptive Lighting will correctly wait for all transitions before doing anything, and alt_detect_method finds non ha changes without calling update_entity. The interval will now only update attributes, and check if things need to be done. I hope we can get this in a release for everyone in the near future. cnt_significant_changes can be added back if needed, but I'd be surprised if it is still required. |
This could be improved by instead starting the transition timer when |
Also sleep the correct time.
592c387
to
4ebfbee
Compare
@basnijholt Hey, hope you're having a good weekend 😄 Do you have a development plan for the next release? I'd like to get the fix ' |
Hi @th3w1zard1!
Every single time I look at this PR I get a bit overwhelmed because it changes 20-30% of the lines in |
Merge `upstream/main` Timer should start when we first detect the state change in `TurnOnOffListener`, not when we call `light.turn_on` TODO: warn user when light doesn't change states from a previous `light.turn_on` call.
I absolutely will do that for you, no problem at all! Thanks for the honesty, I should have done this from the start! |
…ha_changes_slowattempt
@basnijholt I created a new branch on your repo as some of these changes only can merge into each other |
This is a rewrite designed to accomplish the following:
detect_non_ha_changes
to suit goal 1_adapt_lights
has been renamed to_update_manual_control_and_maybe_adapt
and all manual control checks have been moved there.This pr slightly reworked TurnOnOffListener's
last_state_change
dictionary as it now stores all state changes done to our lights, The old behavior where it is cleared on every new adapt is still there.Based on #450
Things this PR fixed that are broken in the main Adaptive Lighting releases ranging from versions 1.3.0 to 1.7.0:
detect_non_ha_changes: true
set. Seedetect_non_ha_changes
does not detect non ha changes during adapt transitions #447light.turn_on
calls with the same data repeatedly shorten the overall transition with each call. See Inaccurate light transitions whileinterval
is significantly smaller. #400detect_non_ha_changes
breaking.Things this PR would improve: