mirror of
https://github.com/vakius/hassio-addon-lifepo4wered.git
synced 2026-08-01 20:44:12 +03:00
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:
Binary file not shown.
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user