We've added an example to our GitHub repository that shuts down the operating system after a specified time following a Bluetooth disconnection between your phone and Hudiy.
When the shutdown timer is active, a power icon appears in the status bar. The script also periodically displays notifications indicating how many minutes remain until the system shuts down. If the phone reconnects to Hudiy via Bluetooth, the timer is canceled and will only reactivate upon the next disconnection.
The timer can be manually reset using the reset_shutdown action, which the script registers in Hudiy. You can add this action to shortcuts.json or applications_menu.json.
The script: https://github.com/wiboma/hudiy/blob/ma ... hutdown.py