Raspberry Pi 5 Power Button to Clean Shutdown HASSIO

The RaspberryPi5 (rpi5) board has an inbuilt power button. Raspberry Pi Desktop and Raspberry Pi OS Lite interact with this button to trigger a clean shutdown. I’m wondering if there’s a way to configure HASSIO to also trigger a clean shutdown when this button is pressed.

A single or double press while HASSIO is running doesn’t do anything that I can see. I think a long press does a hard shutdown but haven’t tested this. If HASSIO is shutdown (red light on rpi5 board) a single press starts it back up.

I’m using Home Assistant Core: 2024.3.0, Supervisor: 2024.02.1, OS: 12.0, Frontend: 20240306.0

This would be a nice feature. I am experiencing the same issue as described here, wherein my HA has loaded improperly and the Shutdown option has disappeared. The SSH add-on is also inactive, as are all of my add-ons, for some reason. So, I cannot shutdown from the terminal. I think I might be left with one option: long press of the power button on my Pi5. I would prefer not to.