mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 14:54:04 +02:00
Compare commits
29 commits
main
...
fix-autore
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeeddd034a | ||
|
|
2f0223d603 | ||
|
|
98390a5bab | ||
|
|
6ef8d414e4 | ||
|
|
04b3c53754 | ||
|
|
5648750f92 | ||
|
|
eb572093a7 | ||
|
|
29ce84b27c | ||
|
|
1193f4d102 | ||
|
|
8ad56a3403 | ||
|
|
ad897fdcba | ||
|
|
e17902484e | ||
|
|
11c4d72bcc | ||
|
|
3a79c8dd6a | ||
|
|
82c57cc82f | ||
|
|
d910bf5f7e | ||
|
|
163493b6d4 | ||
|
|
255b443f25 | ||
|
|
bb09c73dda | ||
|
|
d5c0fe1f0f | ||
|
|
eb7786352e | ||
|
|
4508c3939d | ||
|
|
814bbd6abc | ||
|
|
34b3dee773 | ||
|
|
af6db3dc65 | ||
|
|
a591b238a2 | ||
|
|
cf8bd946ca | ||
|
|
a641f28d3e | ||
|
|
76a0f898d9 |
3 changed files with 12 additions and 9 deletions
8
.github/workflows/pytest.yaml
vendored
8
.github/workflows/pytest.yaml
vendored
|
|
@ -27,9 +27,13 @@ jobs:
|
|||
- python-version: "3.10"
|
||||
core-version: "2023.4.6"
|
||||
- python-version: "3.10"
|
||||
core-version: "2023.5.2"
|
||||
core-version: "2023.5.4"
|
||||
- python-version: "3.11"
|
||||
core-version: "2023.6.1"
|
||||
core-version: "2023.6.3"
|
||||
- python-version: "3.11"
|
||||
core-version: "2023.7.3"
|
||||
- python-version: "3.11"
|
||||
core-version: "2023.8.1"
|
||||
- python-version: "3.11"
|
||||
core-version: "dev"
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -2013,11 +2013,9 @@ class AdaptiveLightingManager:
|
|||
|
||||
# Don't await to avoid blocking the service call.
|
||||
# Assign to a variable only to await in tests.
|
||||
self.adaptation_tasks.add(
|
||||
asyncio.create_task(
|
||||
switch.execute_cancellable_adaptation_calls(adaptation_data),
|
||||
),
|
||||
)
|
||||
coro = switch.execute_cancellable_adaptation_calls(adaptation_data)
|
||||
task = self.hass.async_create_task(coro)
|
||||
self.adaptation_tasks.add(task)
|
||||
# Remove tasks that are done
|
||||
if done_tasks := [t for t in self.adaptation_tasks if t.done()]:
|
||||
self.adaptation_tasks.difference_update(done_tasks)
|
||||
|
|
|
|||
|
|
@ -766,6 +766,7 @@ async def test_auto_reset_manual_control(hass):
|
|||
|
||||
async def update():
|
||||
await switch._update_attrs_and_maybe_adapt_lights(context=context, transition=0)
|
||||
await asyncio.gather(*switch.manager.adaptation_tasks)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
async def turn_light(state, **kwargs):
|
||||
|
|
@ -796,10 +797,10 @@ async def test_auto_reset_manual_control(hass):
|
|||
)
|
||||
|
||||
# Do a couple of quick changes and check that light is not reset
|
||||
for i in range(3):
|
||||
for i in range(15): # do 15 changes to get to >0.1s
|
||||
_LOGGER.debug("Quick change %s", i)
|
||||
await turn_light(True, brightness=(i + 1) * 20)
|
||||
await asyncio.sleep(0.05) # Less than 0.1
|
||||
await asyncio.sleep(0.01) # Less than 0.1
|
||||
assert manual_control[light.entity_id]
|
||||
|
||||
await update()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue