Skip to content

fix(monitoring): report no judgement for a point whose monitoring is off - #332

Merged
cayossarian merged 1 commit into
prerelease/2.2from
fix/monitoring-off-status
Oct 22, 2026
Merged

cayossarian merged 1 commit into
prerelease/2.2from
fix/monitoring-off-status

Conversation

@cayossarian

Copy link
Copy Markdown
Member

A circuit or main breaker whose current monitoring is turned off kept the utilization, last current and alert window it had when monitoring stopped. The panel view and Get monitoring status showed that frozen figure for a point nobody monitors. 2.1.2 has the same behaviour.

Change

  • current_monitor.py, get_monitoring_status: a circuit with monitoring off reports null for utilization, last current and over-threshold since. The same applies to the mains entry's utilization and peak current.
  • current_monitor.py, set_circuit_override and set_mains_override: turning monitoring off drops the point's last sample and closes any open window. Turning it back on starts a fresh window, so it cannot alert on one opened before. Past alert times are kept.
  • CHANGELOG: one Fixed entry under 2.2.0.

Checks

  • New tests in TestStatusWhileMonitoringIsOff:
    • a circuit turned off reports null and keeps its alert history;
    • a circuit turned back on starts with no stale window;
    • a shared-meter group, off and back on;
    • the mains, off and back on;
    • the mains turned back on starts with no stale window;
    • overrides loaded from storage report null.
  • Each of the five parts of the change was removed in turn: the circuit reset, the mains reset, the circuit current mask, the circuit window mask and the mains mask. A test failed every time.
  • Full suite against the published span-panel-api 3.8.0b1, schema-0 1.3.0b1 and schema-1 1.4.0b2: 2470 passed, 1 skipped. mypy is clean, and all commit hooks pass.

Not covered

  • No test pins that editing a threshold, without turning monitoring off, leaves the window alone.
  • The combined Mains entry reads only upstream_l1's override. A disable stored for L2 only is not masked. This predates this change.

get_monitoring_status kept the utilization, last current and over-threshold
time a circuit or the mains had when its monitoring was turned off, so the
panel view showed a frozen figure for a point nobody monitors. Those fields now
read null while monitoring is off, and turning it off drops the sample and open
window so a later re-enable does not alert on a window from before.
@cayossarian
cayossarian merged commit 6e96ca0 into prerelease/2.2 Oct 22, 2026
7 checks passed
@cayossarian
cayossarian deleted the fix/monitoring-off-status branch October 22, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant