Mobile App: Expose Cloud Remote UI FQDN in registration response (#22055)

* Add a callback to get the cloud remote UI FQDN

* Expose Cloud Remote UI FQDN in the registration response

* Return a URL instead of FQDN
This commit is contained in:
Robbie Trencheny authored and Paulus Schoutsen committed 2019-03-15 10:59:25 -07:00
1 parent 11ebb3f24e
commit 0029dc3813
3 files changed
+23 -2

No files matched your search

@@ -118,6 +118,16 @@ async def async_delete_cloudhook(hass, webhook_id: str) -> None:
await hass.data[DOMAIN].cloudhooks.async_delete(webhook_id)
@bind_hass
@callback
def async_remote_ui_url(hass) -> str:
"""Get the remote UI URL."""
if not async_is_logged_in(hass):
raise CloudNotAvailable
return "https://" + hass.data[DOMAIN].remote.instance_domain
def is_cloudhook_request(request):
"""Test if a request came from a cloudhook.