mirror of
https://github.com/vakius/hassio-addon-lifepo4wered.git
synced 2026-08-02 04:45:17 +03:00
Keep UPS power on when the addon is stopped
The daemon treats SIGTERM as system shutdown and clears PI_RUNNING, making the UPS cut power seconds after the addon stops. Trap the stop signal and SIGKILL the daemon instead so the UPS is never notified. When the daemon exits on its own because the UPS commanded a shutdown (button, low battery, auto shutdown), its init-0 trigger is useless in a container, so run.sh now performs a clean host shutdown through the Supervisor (requires hassio admin role). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
14
README.md
14
README.md
@@ -30,6 +30,20 @@ LIFEPO4WERED_FAKE=1 MQTT_HOST=... python3 hassio-addon-lifepo4wered/lifepo4wered
|
||||
|
||||
`LIFEPO4WERED_FAKE=1` replaces the CLI with embedded sample data.
|
||||
|
||||
## Stopping the addon vs. shutting down
|
||||
|
||||
Stopping the addon does **not** power off the Pi: the daemon is killed
|
||||
without notifying the UPS, so power stays on (`run.sh` traps the stop
|
||||
signal — the daemon would otherwise report "system shutting down" and the
|
||||
UPS would cut power seconds later). While the addon is stopped, UPS-side
|
||||
features (button shutdown, low-battery clean shutdown, boot watchdog
|
||||
handshake) are inactive until it starts again.
|
||||
|
||||
When the UPS itself commands a shutdown (button press, low battery,
|
||||
`AUTO_SHDN_TIME` after power loss), the addon performs a clean host
|
||||
shutdown through the Supervisor, and the UPS cuts power once shutdown
|
||||
completes.
|
||||
|
||||
## Setup notes
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user