Compare commits

...

29 commits

Author SHA1 Message Date
Bas Nijholt
aeeddd034a shorter periods 2023-08-10 15:59:41 -07:00
Bas Nijholt
2f0223d603 await in test again 2023-08-10 14:12:32 -07:00
Bas Nijholt
98390a5bab revert tests 2023-08-10 14:07:23 -07:00
Bas Nijholt
6ef8d414e4 undo log 2023-08-10 14:03:38 -07:00
Bas Nijholt
04b3c53754 remove log statement 2023-08-10 13:58:20 -07:00
Bas Nijholt
5648750f92 assert 0 2023-08-10 13:49:49 -07:00
Bas Nijholt
eb572093a7 await switch.manager.adaptation_tasks 2023-08-10 13:48:36 -07:00
Bas Nijholt
29ce84b27c add log 2023-08-10 13:19:23 -07:00
Bas Nijholt
1193f4d102 remove logging call and use hass.async_create_task 2023-08-10 13:14:54 -07:00
Bas Nijholt
8ad56a3403 add one more logging call 2023-08-10 13:10:21 -07:00
Bas Nijholt
ad897fdcba add more logging 2023-08-10 13:02:24 -07:00
Bas Nijholt
e17902484e probably 3a06659120aa629e0db290ec9e83e2ad129baaf3 is the cause 2023-08-10 12:14:35 -07:00
Bas Nijholt
11c4d72bcc limit range 2023-08-10 12:08:26 -07:00
Bas Nijholt
3a79c8dd6a limit range 2023-08-10 11:54:32 -07:00
Bas Nijholt
82c57cc82f test more 2023-08-10 11:48:04 -07:00
Bas Nijholt
d910bf5f7e run a crazy amount of jobs 2023-08-10 00:50:57 -07:00
Bas Nijholt
163493b6d4 one before 2023.7.3 and one after 2023-08-10 00:45:01 -07:00
Bas Nijholt
255b443f25 more 2023-08-10 00:30:44 -07:00
Bas Nijholt
bb09c73dda more 2023-08-09 23:39:49 -07:00
Bas Nijholt
d5c0fe1f0f more 2023-08-09 23:32:16 -07:00
Bas Nijholt
eb7786352e more 2023-08-09 23:25:42 -07:00
Bas Nijholt
4508c3939d verify error in 2023.8.0 2023-08-09 23:19:10 -07:00
Bas Nijholt
814bbd6abc use full ref 2023-08-09 23:18:18 -07:00
Bas Nijholt
34b3dee773 more tests 2023-08-09 23:15:24 -07:00
Bas Nijholt
af6db3dc65 Merge remote-tracking branch 'origin/main' into fix-autoreset-dev-core 2023-08-09 23:10:17 -07:00
Bas Nijholt
a591b238a2 Test working and non-working 2023-08-09 23:09:14 -07:00
Bas Nijholt
cf8bd946ca remove loggin 2023-08-09 18:28:10 -07:00
Bas Nijholt
a641f28d3e change times 2023-08-09 18:27:42 -07:00
Bas Nijholt
76a0f898d9 Fix autoreset_control_seconds_test on dev HA core 2023-08-09 17:41:33 -07:00
3 changed files with 12 additions and 9 deletions

View file

@ -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:

View file

@ -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)

View file

@ -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()