-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
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
Fix nfandroidtv service notify disappears when restarting home assistant #128958
base: dev
Are you sure you want to change the base?
Fix nfandroidtv service notify disappears when restarting home assistant #128958
Conversation
Hey there @tkdrob, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
15e2396
to
4a94fb9
Compare
803f7d7
to
19372ad
Compare
19372ad
to
cdf8099
Compare
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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 PR is incorrect.
- Previously we tried connecting when setting up the integration, and if we could not connect we would raise
ConfigEntryNotReady
, causing the setup to be tried again a minute later. - I am not sure how error handling fixes the notify service dissapearing from Home Assistant. Can you elaborate on that? Because if the integration is unable to setup, it would have a reason to
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
@joostlek Thank you for reviewing this pull request. I did some further testing. So in my opinion it's perfectly fine to remove |
Right, let me ask around to see what we want with this situation |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
My two cents:
|
Any news on this? I would also be happy to write tests if the changes are accepted. |
Okay let me dive into this again.
So in theory, if the config entry setup is retried, it will retry indefinetly until it works. And when it works, it should just add the service. I am fairly certain that that works. I do understand that that leaves you without service from restart until the tv is turned on. We also don't like flapping services. Hence we have introduced the notify entity, which would be called via a generic action, rather than have 1 action for every notify target. So this is how I see the situation, please let me know if this is correct or if I am missing something, after that I will take this up with some other people to hopefully unblock this PR. |
Everything is correct. Do I understand that correctly: The generic notification service is still under development and has not been implemented yet? So the service call will change like this?
|
It has been implemented, but very few have it implemented yet, mostly because it's not usable by most integrations. In the coming months that will be improved |
sVnsation:sVnsation-nfandroidtv_issue_108296
Breaking change
No
Proposed change
Fixes Issue #108296
These changes should ensure that the notify action ‘notify.android_tv’ is always available, even if the Android Device (TV) is switched off. The connection is only established when a message is actually to be sent.
in
__init__.py
:hass.data[DOMAIN][entry.entry_id]
to be able to use it later innotify.py
.in
notify.py
:NFAndroidTVNotificationService
class has been customised to store the host information and establish the connection when needed.send_message
method now tries to establish a connection if it does not yet exist and catchesConnectError
exceptions.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
.To help with the load of incoming pull requests: