Skip to content

fix: register supernotify.* actions in async_setup (quality scale action-setup) - #345

Merged
jeyrb merged 2 commits into
mainfrom
quality-action-setup
Nov 25, 2026
Merged

jeyrb merged 2 commits into
mainfrom
quality-action-setup

Conversation

@jeyrb

@jeyrb jeyrb commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Step 1 of 3 towards an accurate quality scale level. action-setup was the one Bronze rule not met, so the declared Silver level was overstated. With this, Bronze and Silver are both met.

  • actions.py: async_setup_actions(hass) registers the supernotify.* actions once, from async_setup, so they exist whether or not the config entry is loaded, and automations using them always validate. Each handler looks up the loaded entry's engine when called (_loaded_engine), raising a translated ServiceValidationError (not_loaded) when there isn't one.
  • Unloading no longer removes the actions, so async_unregister_engine_actions and ACTION_NAMES are gone.
  • enquire_configuration reads the config from the new SupernotifyEngine.full_config, rather than from a value captured at registration.
  • not_loaded message added in all 11 languages.
  • quality_scale.yaml: action-setup marked done. Changelog entry under v2.19.2. The manifest version is unchanged, as the release is being held.

notify.supernotify is unchanged: it's the legacy notify service and still follows the entry.

Test plan

  • New: actions exist before the entry loads (disabled entry), and raise not_loaded
  • New: after unload, actions still exist and raise not_loaded
  • Updated: disable/re-enable and remove/re-add tests expect the actions to stay, and check they act on the re-added entry's engine
  • Full suite: 2940 passed, 97.5% coverage
  • prek run (ruff, mypy, ty, codespell, bandit)

🤖 Generated with Claude Code

jeyrb and others added 2 commits November 25, 2026 15:59
…ion-setup)

The actions were registered when the config entry loaded and removed when
it unloaded, so automations using them failed validation while Supernotify
was starting or after a failed setup. They are now registered once from
async_setup, and each looks up the loaded entry's engine when called,
raising a translated ServiceValidationError when it isn't loaded.

This was the one Bronze rule not met. enquire_configuration now reads the
config from SupernotifyEngine.full_config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeyrb
jeyrb merged commit e0de2b5 into main Nov 25, 2026
9 of 16 checks passed
@jeyrb
jeyrb deleted the quality-action-setup branch November 25, 2026 16:05
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