-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable config flow for html5 #112806
base: dev
Are you sure you want to change the base?
Enable config flow for html5 #112806
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good to me. I've looked at a number of other integrations using config flow with the notify platform (i.e. google_mail) and the approach seems consistent.
The notifications are consistent with the following architecture policy: https://github.com/home-assistant/architecture/blob/master/adr/0021-YAML-integration-configuration-deprecation-policy.md
The removal of the gcm_api_deprecated
makes sense to be included in this PR as it's part of the old config and shouldn't be carried over to the config flow.
The tests look good with 100% coverage.
A few suggestions and one question about the parameters passed to async_load_platform
below. Also I'm not sure it makes sense to make the service async for the reason below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One item left which is to revert the get_service
back to a sync function unless I'm somehow missing why it was necessary.
The |
Its not thread-safe to call |
fa757b0
to
e7f3c97
Compare
Ah ok, my bad I didn't know that, thanks @bdraco. This is all good from me, thanks @alexyao2015! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
856722f
to
aa45b24
Compare
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
|
||
# Iterate all entries for notify to only get HTML5 | ||
for entry in config.get(Platform.NOTIFY, {}): | ||
if entry[CONF_PLATFORM] == DOMAIN: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if entry[CONF_PLATFORM] == DOMAIN: | |
if entry[CONF_PLATFORM] != DOMAIN: | |
continue |
Than outdent below
notify.html5 service is missing though |
Issue is fixed |
I did some testing. Some observations:
|
I retested this again.
|
It seems like it defeats the purpose of converting to a config flow if you have to restart for the service to exist. We could use the discovery helper to discover the new service immediately. |
This mainly helps with setup so users don't have to manually obtain vapid keys since they are now automatically generated.
Do you have an example of how to do that? |
Breaking change
Proposed change
This converts HTML5 to use config flow. In the process, this also removes the need for the user to manually obtain a VAPID key as it is now automatically generated.
This also removes the long deprecated GCM configuration method.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: