github rhizomatics/supernotify v2.0.0

latest releases: v2.14.0, v2.14.0-beta9, v2.14.0-beta8...
one month ago

Major change to Supernotify to introduce standard Home Assistant UI installation and configuration, and a new supernotify configuration domain for advanced YAML config (deliveries, transports, scenarios etc)

ConfigFlow

  • SuperNotify is now set up using the standard HomeAssistant UI ('ConfigFlow')
    • This covers basic use cases using default deliveries, like mobile push and email
    • More advanced configuration - like scenarios, cameras, transport, action configs etc - continues to require YAML configuration
    • That YAML now lives under a top-level supernotify: key, not the old notify: - platform: supernotify block - typically split out with supernotify: !include supernotify.yaml
    • The config entry is now the sole, unconditional owner of the notify.supernotify action - no more dual registration between YAML and the UI
    • A leftover notify: - platform: supernotify block is inert (nothing is registered from it) but raises a fixable repair that automates the move: writes supernotify.yaml, adds the include line, reloads immediately - no restart needed. Migrating by hand instead works just as well; either way, deleting the old block afterwards is what makes the repair stop reappearing
    • A custom name: from that old block (which determines the actual notify.<name> action, e.g. name: SuperNotifier → notify.supernotifier) is kept in sync automatically on every load, independent of whether the repair has been run yet - existing installs don't lose their action name mid-upgrade
    • Core config (archive/dupe_check/housekeeping/paths/name) is reconfigurable via UI, and now actually applies immediately via an update listener - no reload/restart needed

Technical Changes

  • Step 1 of the roadmap updated to minimize reuse of 'legacy' integration style, then extended further to retire that legacy style entirely for the notify-platform registration
  • Details
    • config_flow.py — zero-required-field user step (reproduces minimal.yaml), options flow with archive/dupe_check/housekeeping pages, single_config_entry enforced, plus a name field determining the registered action.
    • __init__.py — CONFIG_SCHEMA/async_setup for the top-level supernotify: key; async_setup_entry unconditionally owns notify.supernotify, computing the service name from entry.data[name]; an update listener reloads the entry so options/reconfigure changes apply immediately.
    • notify.py — async_get_service (the legacy notify: platform entrypoint) reduced to a shim: raises the migration repair and syncs entry.data[name] from the legacy config on every load, but registers nothing itself.
    • manifest.json — config_flow: true, single_config_entry: true, notify added to dependencies.
    • strings.json + all 11 translations/*.json — new fields, options pages, and the migration repair's fixable flow text.
    • schema.py — split into SUPERNOTIFY_YAML_SCHEMA (8 YAML-only keys), CONFIG_ENTRY_SCHEMA (8 ConfigEntry-owned keys), FULL_CONFIG_SCHEMA (single-pass union, for tests) - _entry_full_config validates entry.data/options through CONFIG_ENTRY_SCHEMA and merges in the already-validated YAML section as-is, rather than re-validating a combined dict a second time (which would reject values a first pass already coerced, e.g. cv.template's Template objects).
    • repairs.py (new) — the legacy_yaml_config fixable repair: writes supernotify.yaml + appends the include line, validated on the event loop before writing (cv.template's bare-Jinja-string condition shorthand needs the event-loop-bound hass context, so this can't happen from the executor thread the file I/O runs in), validates configuration.yaml as a whole before and after via async_check_ha_config_file, rolls back and logs the underlying error on any failure, raises a separate persistent legacy_yaml_manual_migration_required issue when automation can't proceed, and serializes the whole write-and-reload sequence behind a lock so two concurrent attempts can't interleave.
    • Tests: test_config_flow.py, test_init.py, test_repairs.py (new), test_config_yaml.py, test_example_configs.py all updated/added for the new architecture.
    • Docs: docs/configuration/yaml.md, email.md and docs/recipes/contextual_mobile_actions.md updated for the top-level supernotify: key; docgen/schema_extractor.py updated for the renamed schema.
    • Fix log errors from accessing version in manifest.json and eager loading MQTT component
  • Silver level HA Quality Level Checks
    • Stage 2 of the roadmap partially implemented, 'Bronze' level only
    • Better testing of user supplied values in config
    • Additional services moved to shared yaml/ui config code
    • Improved exception handling
  • Template Path
    • Directory now created if specified and doesn't exist
    • Default is relative to config home rather than hard-coded to /config
    • Better logging for path actions
  • Async I/O
    • Final 2 media_grab.py Pillow image I/O wrapped as async
    • SMTP attach file now uses aiofiles

Full Changelog: v1.7.1...v2.0.0

Don't miss a new supernotify release

NewReleases is sending notifications on new releases.