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

Adapt lights simultaneously instead of one by one #529

Merged
merged 12 commits into from
Aug 6, 2023

Conversation

th3w1zard1
Copy link
Collaborator

For users using high values of send_split_delay, it's very noticeable how multiple lights in a switch turn on one after another.

@th3w1zard1 th3w1zard1 changed the title Small change - Adapt lights simultaneously. ( Small Change ) Adapt lights simultaneously. Apr 4, 2023
@th3w1zard1
Copy link
Collaborator Author

I don't know how such a simple change doesn't pass the test.

@th3w1zard1 th3w1zard1 marked this pull request as ready for review April 4, 2023 08:17
tests/test_switch.py Outdated Show resolved Hide resolved
@th3w1zard1
Copy link
Collaborator Author

th3w1zard1 commented Apr 8, 2023

I've verified on multiple different stackoverflow threads that this syntax is correct... I'm very confused about how it doesn't pass the test. I even tried increasing the time in test_manual_control (correctly this time not 87ea524 where I modified the wrong value)

With this issue and the issue from 1.10.0, I believe there's an unforeseen issue with _AsyncSingleShotTimer. We still haven't completely resolved the issue from 1.10.0: it's supposed to call the reset() function when the timer finishes yet the transition timer's reset() function is never called. We merely just check timer.is_running() as a decent band-aid in 1.11.0

@th3w1zard1 th3w1zard1 changed the title ( Small Change ) Adapt lights simultaneously. Adapt lights simultaneously. Apr 10, 2023
@th3w1zard1
Copy link
Collaborator Author

Fixed. hass.async_create_task was the solution. It now passes the pytest.

@basnijholt basnijholt changed the title Adapt lights simultaneously. Adapt lights simultaneously instead of one by one Aug 6, 2023
@basnijholt basnijholt enabled auto-merge (squash) August 6, 2023 04:12
@basnijholt
Copy link
Owner

Sorry for the delay!

This is great. I just made a small change such that the errors are preserved.

@basnijholt basnijholt merged commit fec50ad into main Aug 6, 2023
15 checks passed
@basnijholt basnijholt deleted the adapt_multiple_lights_simultaneously branch August 6, 2023 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants