Fix entity names and add units per the product brief

VOUT_MAX is the safety limit above which the UPS refuses to boot an
externally-powered Pi, not an output voltage setting. Also clarify
PI_RUNNING, WATCHDOG_GRACE and TOUCH_STATE names, and add documented
units: timeouts and watchdog values are CLI-scaled seconds,
AUTO_SHDN_TIME is minutes; SHDN_DELAY stays raw ticks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
vaku
2026-07-19 00:53:01 +03:00
parent c1c96d3cfb
commit 93c1f8d3bc
5 changed files with 30 additions and 15 deletions

View File

@@ -62,6 +62,17 @@ class DiscoveryTest(unittest.TestCase):
self.assertEqual(cfg["entity_category"], "diagnostic")
self.assertEqual(cfg["unit_of_measurement"], "V")
def test_timer_registers_have_documented_units(self):
for key, unit in (("pi_boot_to", "s"), ("pi_shdn_to", "s"),
("watchdog_grace", "s"), ("watchdog_timer", "s"),
("auto_shdn_time", "min")):
cfg = self.messages[
"homeassistant/sensor/lifepo4wered/%s/config" % key]
self.assertEqual(cfg["unit_of_measurement"], unit, key)
self.assertNotIn(
"unit_of_measurement",
self.messages["homeassistant/sensor/lifepo4wered/shdn_delay/config"])
def test_skipped_registers_have_no_entity(self):
for key in ("i2c_reg_ver", "dco_rsel", "vbat_offset", "cfg_write"):
self.assertNotIn(