Skip to content

Add UI config flow and async API client - #6

Open
Sarnog wants to merge 17 commits into
1RandomDev:masterfrom
Sarnog:master
Open

Sarnog wants to merge 17 commits into
1RandomDev:masterfrom
Sarnog:master

Conversation

@Sarnog

@Sarnog Sarnog commented Nov 28, 2026

Copy link
Copy Markdown

What

Moves the setup from YAML to a UI config flow and adds an async Gotify API client.

  • Add/reconfigure/re-authenticate from the UI; server and token are validated live.
  • Existing YAML configuration is still imported via a repair notice.
  • Pure aiohttp API client with typed errors (auth vs. connection).
  • pytest suite and ruff config.

Why

Home Assistant is moving away from YAML configuration for integrations, and the
UI flow also gives proper error messages and reauth.

Compatibility

Existing notify: YAML blocks keep working through the import flow.

Notes

Developed with the help of an AI coding assistant and tested against my own
Gotify server. Happy to split this into smaller PRs if you prefer.

Sarnog added 17 commits August 13, 2026 11:08
The client talks to the Gotify server over aiohttp instead of blocking
requests calls, and knows how to verify a server (GET /version) and an
application token (an empty POST /message, which Gotify rejects before it
would create a notification).
Adds a config flow (add, reconfigure, reauth) that validates the server
and the application token before storing an entry. The notify service is
created from the config entry via the discovery route - the same pattern
the official Pushover integration uses - so priority and extras keep
working, unlike a modern notify entity.

An existing notify: block in configuration.yaml is imported into a config
entry once, keeping the same notify.<name> service, and a repair issue
asks to remove the YAML afterwards. Texts are translated in English and
Dutch.
Enables config_flow, sets @Sarnog as codeowner and the fork's URLs as
documentation and issue tracker.
Covers the API client, the config flow helpers and the notify service
logic. The workflows now also run ruff and pytest next to the existing
hassfest and HACS validation.
…L + EN)

README is a timeless bilingual manual (setup, usage, migrating from YAML,
credits to the upstream project), ARCHITECTURE.md documents the layers and
why a classic notify service is used, ROADMAP.md collects ideas.
Gotify's server announces nothing over mDNS/zeroconf/SSDP/UPnP, so there
is nothing for Home Assistant to listen for; noted in ROADMAP so it does
not get re-investigated later.
The attribution only lived in the credits section at the bottom, so
readers had no idea what this is a fork of.
… EN)

Adding a server through the UI and sending with priorities are now
confirmed on a live Home Assistant; only importing an existing notify:
block is still unverified in practice.
…(NL + EN)

This fork's maintainer never ran the YAML version, so the import cannot
be verified in-house; ask for an issue report instead.
Adds icon.png (256x256) and icon@2x.png (512x512), derived from the
official gotify/logo artwork (CC BY 4.0) by trimming and downscaling
only. Credited in the README as the license requires.

These files are the source assets; Home Assistant serves integration
icons from the home-assistant/brands repository, so a PR there is what
actually makes the icon show up.
The brand/ folder was added after the v2.0.0 tag, so HACS users never
received the icon. Bumps the manifest and documents in brand/README.md
why the icon ships locally: home-assistant/brands refuses brand assets
for custom integrations since HA 2026.3, and Home Assistant reads a
brand/ folder inside the integration with priority over the CDN.
Inclusion in the default HACS store requires the action to pass without
ignored checks, and the brands check now passes because the icon ships
in custom_components/gotify/brand/.
Hassfest rejects any scheme://host or www. form inside a translation
value; the URL field's example address tripped that in all three files.
This repository's default branch is master, so the push trigger never
fired - only the nightly schedule ran, and the Test workflow (which has
no schedule) had never run at all.
Ships the hassfest fix: v2.0.1 still contained translation strings with
example URLs, which Home Assistant's validation rejects.
De losse regel "Vereist Home Assistant 2024.12 of nieuwer" is vervangen door
een onderbouwde regel boven aan de installatie-instructies, in beide talen.
De bindende ondergrens is 2024.6: `ConfigEntry.runtime_data` en de generieke
`ConfigEntry` staan pas vanaf die versie in de core (nagekeken in
homeassistant/config_entries.py op de tags 2024.5.0 en 2024.6.0).

hacs.json eiste 2024.12.0 zonder dat er iets in de code die grens
rechtvaardigt - de notify-laag, de config flow en de reparatiemeldingen
gebruiken allemaal oudere API's. Die grens staat nu gelijk aan wat de code
echt vraagt.
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