-
Notifications
You must be signed in to change notification settings - Fork 125
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
Only start adapting on light.turn_on
when detect_non_ha_changes: false
to prevent unwanted light turn ons
#663
Conversation
9413168
to
90a41ad
Compare
0d1e80e
to
723a73f
Compare
723a73f
to
36fbff0
Compare
8796e27
to
5aa0d41
Compare
updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.279 β v0.0.280](astral-sh/ruff-pre-commit@v0.0.279...v0.0.280) - [github.com/psf/black: 23.3.0 β 23.7.0](psf/black@23.3.0...23.7.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
I'm very lost here, but if it works, it works right? π |
light.turn_on
when detect_non_ha_changes: false
to prevent unwanted light turn ons
Hi, thanks for your work :) |
Unfortunately, the only workaround is
|
Great news, there might be a solution to the 'lights turning on by itself'-issue! π π
I also had a major insight yesterday going through the code line-by-line.
I believe the issue of lights turning on is always because for some reason: the light will incorrectly report its state as on! (as mentioned by @th3w1zard1 above).
Because AL then notices a state change, and this state is likely not precisely what it should be according to AL, it will adapt it to the correct state, inadvertently turning the lights on.
In this PR, I have made some changes. With that code when
detect_non_ha_changes: false
and there is a 'off' β 'on' state change which is not the result of alight.turn_on
, it will mark the light as manually controlled and not adapt it at all.I have one light at home which frequently turns on again after I turned it off, I will see whether this still happens with the changes. If not, I will merge and release a new version.
ref #10, #622, #85