Off (default): SIGKILL the daemon on addon stop so the UPS keeps power
on. On: SIGTERM it (native behavior) so it saves the RTC and tells the
UPS to cut power. Add translations so the option is documented in the
HA config UI, and document the difference in the README.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
Poll lifepo4wered-cli every 30s (configurable), publish all registers as
one JSON state payload, and announce sensors/binary sensor via MQTT
discovery. run.sh pulls broker credentials from the Supervisor mqtt
service (Mosquitto addon) with manual overrides in addon options.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>