Add support for UnifiedPush notifications - #5261
Conversation
There was a problem hiding this comment.
Hi @lone-faerie
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
While this works to get started (and is quite similar in some ways to my proof of concept from last year), I feel like there should be a generic interface here. This approach doesn't scale and the push provider can change without the user noticing. |
|
The push provider should only change during onboarding or if the user uninstalls the distributor app. A generic interface does feel like the more proper approach though, perhaps something like the SensorManager. UnifiedPush also has the ability to handle FCM on it's own, though that would require a bit of backend work since it needs a gateway similar to the current cloud functions. |
|
Since you are changing the notification, you will also need two others PR in the developer documentation. |
|
@lone-faerie I'm willing to fund you finishing this work, and doing whatever the Companion / Core devs want done to get this in. Please quote me and let's get the details straightened out. |
@Rudd-O i'm also willing to chip in. maybe we could set up some bounty somewhere and advertise it? is anyone here experienced with an opensource bounty solution that could work here? |
Summary
Adds support for using UnifiedPush as the source for push notifications. This allows both the full and minimal flavors to receive push notifications without a persistent websocket connection and without reliance on Google's Firebase Cloud Messaging. On launch, UnifiedPush is preferred if a distributor is available, otherwise the full flavor falls back to FCM. A setting has also been added to allow the user to manually select the UnifiedPush distributor to use.
Checklist
Screenshots
Link to pull request in documentation repositories
User Documentation: home-assistant/companion.home-assistant#1202
Any other notes
#3174 mentions Home Assistant Core needing to add support before this would work. I'm not sure if it's changed since then, but in my tests UnifiedPush works with Core as-is. A small change to Core would be needed to support encrypting the notifications, but that isn't necessary for UnifiedPush to work.