I have a single automation with multiple triggers that calls a python script (in python_scripts/bathroom.py). It polls a bunch of state and depending on those does some immediate actions (like turning on lights). Now I want it to be able to ‘reschedule’ itself in (say) 5 minutes time and re-run. Depending on state it could reschedule itself several times before finishing.
What’s the cleanest way to have a python script schedule itself in the future? I could loop and use sleep() but that seems to be frowned upon. Ideally I’d like something self-contained to the script that doesn’t require a second automation to wake up the first or anything that requires human config outside of the script.
Thanks.