fix(snmp): a UPS on mains reads "On battery: No, on mains", not "0s" (#5214)
UPS-MIB upsSecondsOnBattery is zero whenever the UPS is on mains power, so "On battery for 0s" read as a timer that had just started. The reading gets its own unit, battery_seconds: zero says "No, on mains", anything else "for <span>". The metric key stays on_battery_for, so stored history keeps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,8 @@ def test_presets_come_in_order_and_names_may_not_repeat():
|
||||
("volts", 121.0, "121 V"),
|
||||
("decivolts", 1203, "120.3 V"),
|
||||
("minutes", 45, "45m"),
|
||||
("battery_seconds", 0, "No, on mains"),
|
||||
("battery_seconds", 300, "for 5m"),
|
||||
("kilobytes", 2048, "2.0 MiB"),
|
||||
("bits_per_second", 12_345_678, "12.3 Mbit/s"),
|
||||
("bits_per_second", 950, "950 bit/s"),
|
||||
|
||||
Reference in New Issue
Block a user