Skip to content

2.3.4 follow-ups: alert names, monitoring refusals, legacy monitoring option - #389

Merged
cayossarian merged 2 commits into
mainfrom
feat/followups-234
Nov 24, 2026
Merged

cayossarian merged 2 commits into
mainfrom
feat/followups-234

Conversation

@cayossarian

Copy link
Copy Markdown
Member

What

Follow-ups for 2.3.4: current-monitoring alert names, monitoring services that refuse a panel that isn't loaded, and the legacy monitoring option. This PR also bundles span-card v0.12.1-beta.3 (SpanPanel/span-card#48), which handles the new refusal. The bundled span-panel-card.js is byte-identical to that release's asset.

Changes

  • Alert names: notifications name a circuit by its Home Assistant name, {name} in custom templates included. A shared meter joins its members' names with " + ". The span_panel_current_alert event gains alert_display_name, and alert_name is unchanged. {entity_id} carries the circuit's Current sensor, else its Power sensor, or the mains leg's Current sensor. No event field changes otherwise.
  • One path for every monitoring service:
    • an entry that is not a SPAN Panel's is refused as monitoring_panel_unknown;
    • an unloaded panel is refused as monitoring_panel_not_loaded;
    • monitoring_not_enabled is left for a loaded panel with monitoring off.
      The package-ratings services follow the same path, under AGENTS.md rule 8.
  • Legacy option: enable_current_monitoring is moved into the monitoring store once at setup and removed from the entry, so monitoring turned off stays off across a restart.

Changelog (2.3.4, Fixed)

  • Current monitoring notifications now name a circuit by the name you gave it in Home Assistant, including through {name} in a custom title or message, where they used its name in the SPAN app; the span_panel_current_alert event carries that name in a new alert_display_name field and leaves alert_name as it was.
  • The Get monitoring status action now fails with an error when the panel it is asked about has not finished loading, such as while Home Assistant starts, or when the config entry it names is not a SPAN Panel's, where it answered that monitoring was off, so a script step that calls it then stops unless it is set to continue on error, and Home Assistant logs the error.
  • Changing a panel's current monitoring while the panel is not loaded, or naming a config entry that is not a SPAN Panel's, now fails with an error, turning monitoring off included, where turning it off reported success and left monitoring to start again once the panel loaded, and turning it on, changing its settings or a threshold named by circuit id or leg, or sending a test notification said monitoring was not enabled.
  • The {entity_id} placeholder in a current monitoring notification's title or message now carries the entity ID of the circuit's Current sensor, or its Power sensor where it has none, or of the mains leg's Current sensor, where it carried the circuit's internal id or the leg's name.
  • Current monitoring turned off now stays off after Home Assistant restarts on a panel whose options still hold the monitoring switch an earlier release stored there, where it came back on at every restart.

Tests

  • New tests/test_alert_display_names.py, plus refusal, write-path and legacy-option tests. Each fails on the previous code or under the review's mutations.
  • Full suite: 4745 passed. mypy, ruff and the pre-commit hooks are clean.

… refuse an unloaded panel

Current monitoring notifications name a circuit by its Home Assistant name,
{name} in custom templates included, and the span_panel_current_alert event
gains alert_display_name while alert_name stays as it was. {entity_id} carries
the circuit's Current sensor, else its Power sensor, or the mains leg's.

Every monitoring service now finds its panel through one path: a config entry
that is not a SPAN Panel's is refused as monitoring_panel_unknown, an unloaded
panel as monitoring_panel_not_loaded, and monitoring_not_enabled is left for a
loaded panel with monitoring off. Get monitoring status no longer answers "off"
for an unloaded panel, and turning monitoring off on one no longer reports
success while doing nothing.

The legacy enable_current_monitoring option is moved into the monitoring store
once at setup and removed from the entry, so monitoring turned off stays off
across a restart.
The release build of span-card v0.12.1-beta.3 (8151fac), which handles the
monitoring_panel_not_loaded refusal; span-panel-card.js is byte-identical to
the release asset.
@cayossarian
cayossarian merged commit 688da68 into main Nov 24, 2026
8 checks passed
@cayossarian
cayossarian deleted the feat/followups-234 branch November 24, 2026 03:55
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