Rework CloudhookURL setup for mobile app#156940
Merged
MartinHjelmare merged 11 commits intoNov 21, 2025
Merged
Conversation
Contributor
|
Hey there @home-assistant/cloud, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
edenhaus
requested changes
Nov 20, 2025
Contributor
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
edenhaus
reviewed
Nov 21, 2025
edenhaus
reviewed
Nov 21, 2025
edenhaus
approved these changes
Nov 21, 2025
edenhaus
previously requested changes
Nov 21, 2025
Member
edenhaus
left a comment
There was a problem hiding this comment.
The tests are failing please have a look at it
MartinHjelmare
requested changes
Nov 21, 2025
MartinHjelmare
approved these changes
Nov 21, 2025
frenck
pushed a commit
that referenced
this pull request
Nov 21, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
This PR attempts to make sure that whenever the CloudhookURL is sent to the mobile_app, the mobile_app can use it. Today the issue we have is that even when the CloudhookURL is deleted it stays in the Entry. Because of that the mobile_app continue to try to use it, causing a failure and the app to fallback to external/internal URLs.
The app cannot assume that the CloudhookURL has been removed since it might be a temporary failure, it needs to come from core that has the knowledge.
The chosen approach is to register a listener on the cloud that is triggered when the CloudhookURL is deleted so that we can remove it from the Entry too.
The CloudhookURL was also sent when the subscription was not active which makes no sense for the mobile_app because the CloudhookURL is not usable in this state.
In order to react to the disable/enable of a CloudHook I've decided to change how we set the CloudHookURL by using a listener instead of using the value created, otherwise we cannot determine when the Cloudhook is enabled back without reloading the mobile_app integration.
Type of change
Additional information
Combining with home-assistant/android#6072 this should remove most of the error going to HA Cloud and reduce drastically the load. Since today all the users that have canceled their subscription are still making requests to HA Cloud even if they all fail. This changes is important for HA Cloud but also for our users by reducing useless queries.
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: