mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 05:16:34 +00:00
parent
19804a713d
commit
1e22d13588
@ -18,3 +18,13 @@ export const deleteCloudhook = (hass: HomeAssistant, webhookId: string) =>
|
|||||||
type: "cloud/cloudhook/delete",
|
type: "cloud/cloudhook/delete",
|
||||||
webhook_id: webhookId,
|
webhook_id: webhookId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const connectCloudRemote = (hass: HomeAssistant) =>
|
||||||
|
hass.callWS({
|
||||||
|
type: "cloud/remote/connect",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const disconnectCloudRemote = (hass: HomeAssistant) =>
|
||||||
|
hass.callWS({
|
||||||
|
type: "cloud/remote/disconnect",
|
||||||
|
});
|
||||||
|
@ -20,6 +20,7 @@ import { fireEvent } from "../../../common/dom/fire_event";
|
|||||||
import { fetchSubscriptionInfo } from "./data";
|
import { fetchSubscriptionInfo } from "./data";
|
||||||
import "./cloud-alexa-pref";
|
import "./cloud-alexa-pref";
|
||||||
import "./cloud-google-pref";
|
import "./cloud-google-pref";
|
||||||
|
import { connectCloudRemote, disconnectCloudRemote } from "../../../data/cloud";
|
||||||
|
|
||||||
let registeredWebhookDialog = false;
|
let registeredWebhookDialog = false;
|
||||||
|
|
||||||
@ -66,6 +67,9 @@ class HaConfigCloudAccount extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
a {
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<hass-subpage header="Home Assistant Cloud">
|
<hass-subpage header="Home Assistant Cloud">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -83,7 +87,7 @@ class HaConfigCloudAccount extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
<div class="account-row">
|
<div class="account-row">
|
||||||
<paper-item-body two-line="">
|
<paper-item-body two-line="">
|
||||||
[[cloudStatus.email]]
|
[[cloudStatus.email]]
|
||||||
<div secondary="" class="wrap">
|
<div secondary class="wrap">
|
||||||
[[_formatSubscription(_subscription)]]
|
[[_formatSubscription(_subscription)]]
|
||||||
</div>
|
</div>
|
||||||
</paper-item-body>
|
</paper-item-body>
|
||||||
@ -94,6 +98,25 @@ class HaConfigCloudAccount extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
<div class="status">[[cloudStatus.cloud]]</div>
|
<div class="status">[[cloudStatus.cloud]]</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="account-row">
|
||||||
|
<paper-item-body two-line>
|
||||||
|
Remote Access
|
||||||
|
<div class="secondary">
|
||||||
|
<a
|
||||||
|
href="https://[[cloudStatus.remote_domain]]"
|
||||||
|
target="_blank"
|
||||||
|
>[[cloudStatus.remote_domain]]</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</paper-item-body>
|
||||||
|
<div class="status">
|
||||||
|
<paper-toggle-button
|
||||||
|
checked="[[cloudStatus.remote_connected]]"
|
||||||
|
on-change="_remoteChanged"
|
||||||
|
></paper-toggle-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<a href="https://account.nabucasa.com" target="_blank"
|
<a href="https://account.nabucasa.com" target="_blank"
|
||||||
><mwc-button>Manage Account</mwc-button></a
|
><mwc-button>Manage Account</mwc-button></a
|
||||||
@ -172,6 +195,22 @@ class HaConfigCloudAccount extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _remoteChanged(ev) {
|
||||||
|
const toggle = ev.target;
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.cloudStatus = toggle.checked
|
||||||
|
? await connectCloudRemote(this.hass)
|
||||||
|
: await disconnectCloudRemote(this.hass);
|
||||||
|
} catch (err) {
|
||||||
|
toggle.checked = !toggle.checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_computeRemoteConnected(connected) {
|
||||||
|
return connected ? "Connected" : "Not Connected";
|
||||||
|
}
|
||||||
|
|
||||||
async _fetchSubscriptionInfo() {
|
async _fetchSubscriptionInfo() {
|
||||||
this._subscription = await fetchSubscriptionInfo(this.hass);
|
this._subscription = await fetchSubscriptionInfo(this.hass);
|
||||||
if (
|
if (
|
||||||
|
@ -74,8 +74,9 @@ class HaConfigCloudLogin extends NavigateMixin(EventsMixin(PolymerElement)) {
|
|||||||
<span slot="header">Home Assistant Cloud</span>
|
<span slot="header">Home Assistant Cloud</span>
|
||||||
<div slot="introduction">
|
<div slot="introduction">
|
||||||
<p>
|
<p>
|
||||||
Home Assistant Cloud connects your local instance securely to
|
Home Assistant Cloud allow you to remotely and securely control
|
||||||
cloud-only services Amazon Alexa and Google Assistant.
|
your instance away from home. It also allows you to connect with
|
||||||
|
cloud-only services like Amazon Alexa and Google Assistant.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
This service is run by our partner
|
This service is run by our partner
|
||||||
|
@ -66,8 +66,10 @@ class HaConfigCloudRegister extends EventsMixin(PolymerElement) {
|
|||||||
The trial will give you access to all the benefits of Home Assistant Cloud, including:
|
The trial will give you access to all the benefits of Home Assistant Cloud, including:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Control Home Assistant away from home</li>
|
||||||
<li>Integration with Google Assistant</li>
|
<li>Integration with Google Assistant</li>
|
||||||
<li>Integration with Amazon Alexa</li>
|
<li>Integration with Amazon Alexa</li>
|
||||||
|
<li>Easy integration with webhook-based apps like OwnTracks</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
This service is run by our partner <a href='https://www.nabucasa.com' target='_blank'>Nabu Casa, Inc</a>, a company founded by the founders of Home Assistant and Hass.io.
|
This service is run by our partner <a href='https://www.nabucasa.com' target='_blank'>Nabu Casa, Inc</a>, a company founded by the founders of Home Assistant and Hass.io.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user