Files
Claude 2c8ebb07e3 Create every event loop with a factory instead of a policy
Python 3.16 removes asyncio event loop policies, which Home Assistant
relies on to configure every loop it runs: the loop that serves a running
instance, and the loops the command line scripts create.

HassEventLoopPolicy only overrode new_event_loop(), so it becomes a
create_event_loop() factory building asyncio.EventLoop, the same platform
loop class the default policy selected.

The policy that scripts/__init__.py installed configured the asyncio.run()
calls inside each script, so the factory is passed at those call sites
instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PRmnu5HiXQUaHcHnNCvBSU
2026-08-22 20:51:48 +00:00
..