How to enable asyncio debug mode?

I’d like to conditionally enable asyncio debug mode for custom component.

In a test app I would call asyncio.run(foo(), debug=true).

Per docs one could:

  • Set PYTHONASYNCIODEBUG=1.
  • Passing debug=True to asyncio.run().
  • Calling loop.set_debug().

Given that asyncio is so widely used in HA, is there a configuration to enable debug mode?

I was trying to find something similar. I have a separate test HA instance and would love to configure it to always have asyncio debug set to true so it catches mistakes that my production instance might miss.

The profiler integration has a service to turn it on as well

Is that persistent across HA restart?

No, its not persistent after restart

set

ayncio: debug

in logger

btw, seems the solved flag is set to a question?

1 Like

That will only turn on debug logging for asyncio, it will not put asyncio in debug mode

1 Like

I see, I didnt notice that, but good to know, thx