diff --git a/hassio/src/update-available/update-available-card.ts b/hassio/src/update-available/update-available-card.ts index 7b32fe8551..5c1ef47b7f 100644 --- a/hassio/src/update-available/update-available-card.ts +++ b/hassio/src/update-available/update-available-card.ts @@ -120,7 +120,7 @@ class UpdateAvailableCard extends LitElement { return html``; } - const changelog = changelogUrl(this._updateType, this._version); + const changelog = changelogUrl(this._updateType, this._version_latest); return html` 1 - ? html` - ${this._cameras!.map( - (camera) => html` - ${camera.label} - ` - )} - ` - : ""} - ${this._error + return html`${this._error ? html`${this._error}` : ""} ${navigator.mediaDevices ? html` -
` +
+ ${this._cameras && this._cameras.length > 1 + ? html` + + ${this._cameras!.map( + (camera) => html` + ${camera.label} + ` + )} + ` + : ""} +
` : html`${!window.isSecureContext ? "You can only use your camera to scan a QR core when using HTTPS." @@ -135,16 +144,23 @@ class HaQrScanner extends LitElement { }; private _cameraChanged(ev: CustomEvent): void { - this._qrScanner?.setCamera((ev.target as Select).value); + this._qrScanner?.setCamera((ev.target as any).value); } static styles = css` canvas { width: 100%; } - mwc-select { - width: 100%; - margin-bottom: 16px; + #canvas-container { + position: relative; + } + ha-button-menu { + position: absolute; + bottom: 8px; + right: 8px; + background: #727272b2; + color: white; + border-radius: 50%; } `; } diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index f864e8a874..6b9008984f 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -43,6 +43,7 @@ import { PersistentNotification, subscribeNotifications, } from "../data/persistent_notification"; +import { getExternalConfig } from "../external_app/external_config"; import { actionHandler } from "../panels/lovelace/common/directives/action-handler-directive"; import { haStyleScrollbar } from "../resources/styles"; import type { HomeAssistant, PanelInfo, Route } from "../types"; @@ -266,6 +267,11 @@ class HaSidebar extends LitElement { subscribeNotifications(this.hass.connection, (notifications) => { this._notifications = notifications; }); + + // Temporary workaround for a bug in Android. Can be removed in Home Assistant 2022.2 + if (this.hass.auth.external) { + getExternalConfig(this.hass.auth.external); + } } protected updated(changedProps) { diff --git a/src/entrypoints/core.ts b/src/entrypoints/core.ts index 03639417ea..2875b3a8e4 100644 --- a/src/entrypoints/core.ts +++ b/src/entrypoints/core.ts @@ -37,6 +37,25 @@ declare global { } } +const clearUrlParams = () => { + // Clear auth data from url if we have been able to establish a connection + if (location.search.includes("auth_callback=1")) { + const searchParams = new URLSearchParams(location.search); + // https://github.com/home-assistant/home-assistant-js-websocket/blob/master/lib/auth.ts + // Remove all data from QueryCallbackData type + searchParams.delete("auth_callback"); + searchParams.delete("code"); + searchParams.delete("state"); + searchParams.delete("storeToken"); + const search = searchParams.toString(); + history.replaceState( + null, + "", + `${location.pathname}${search ? `?${search}` : ""}` + ); + } +}; + const authProm = isExternal ? () => import("../external_app/external_auth").then(({ createExternalAuth }) => @@ -52,23 +71,7 @@ const authProm = isExternal const connProm = async (auth) => { try { const conn = await createConnection({ auth }); - // Clear auth data from url if we have been able to establish a connection - if (location.search.includes("auth_callback=1")) { - const searchParams = new URLSearchParams(location.search); - // https://github.com/home-assistant/home-assistant-js-websocket/blob/master/lib/auth.ts - // Remove all data from QueryCallbackData type - searchParams.delete("auth_callback"); - searchParams.delete("code"); - searchParams.delete("state"); - searchParams.delete("storeToken"); - const search = searchParams.toString(); - history.replaceState( - null, - "", - `${location.pathname}${search ? `?${search}` : ""}` - ); - } - + clearUrlParams(); return { auth, conn }; } catch (err: any) { if (err !== ERR_INVALID_AUTH) { @@ -85,6 +88,7 @@ const connProm = async (auth) => { } auth = await authProm(); const conn = await createConnection({ auth }); + clearUrlParams(); return { auth, conn }; } }; diff --git a/src/external_app/external_auth.ts b/src/external_app/external_auth.ts index 4c7c5f7f21..1917e4bec2 100644 --- a/src/external_app/external_auth.ts +++ b/src/external_app/external_auth.ts @@ -2,7 +2,7 @@ * Auth class that connects to a native app for authentication. */ import { Auth } from "home-assistant-js-websocket"; -import { ExternalMessaging, InternalMessage } from "./external_messaging"; +import { ExternalMessaging, EMMessage } from "./external_messaging"; const CALLBACK_SET_TOKEN = "externalAuthSetToken"; const CALLBACK_REVOKE_TOKEN = "externalAuthRevokeToken"; @@ -36,7 +36,7 @@ declare global { postMessage(payload: BasePayload); }; externalBus: { - postMessage(payload: InternalMessage); + postMessage(payload: EMMessage); }; }; }; diff --git a/src/external_app/external_messaging.ts b/src/external_app/external_messaging.ts index 1ad273d76c..f5640858fc 100644 --- a/src/external_app/external_messaging.ts +++ b/src/external_app/external_messaging.ts @@ -1,3 +1,4 @@ +import { Connection } from "home-assistant-js-websocket"; import { externalForwardConnectionEvents, externalForwardHaptics, @@ -7,39 +8,50 @@ const CALLBACK_EXTERNAL_BUS = "externalBus"; interface CommandInFlight { resolve: (data: any) => void; - reject: (err: ExternalError) => void; + reject: (err: EMError) => void; } -export interface InternalMessage { +export interface EMMessage { id?: number; type: string; payload?: unknown; } -interface ExternalError { +interface EMError { code: string; message: string; } -interface ExternalMessageResult { +interface EMMessageResultSuccess { id: number; type: "result"; success: true; result: unknown; } -interface ExternalMessageResultError { +interface EMMessageResultError { id: number; type: "result"; success: false; - error: ExternalError; + error: EMError; } -type ExternalMessage = ExternalMessageResult | ExternalMessageResultError; +interface EMExternalMessageRestart { + id: number; + type: "command"; + command: "restart"; +} + +type ExternalMessage = + | EMMessageResultSuccess + | EMMessageResultError + | EMExternalMessageRestart; export class ExternalMessaging { public commands: { [msgId: number]: CommandInFlight } = {}; + public connection?: Connection; + public cache: Record = {}; public msgId = 0; @@ -54,7 +66,7 @@ export class ExternalMessaging { * Send message to external app that expects a response. * @param msg message to send */ - public sendMessage(msg: InternalMessage): Promise { + public sendMessage(msg: EMMessage): Promise { const msgId = ++this.msgId; msg.id = msgId; @@ -69,7 +81,9 @@ export class ExternalMessaging { * Send message to external app without expecting a response. * @param msg message to send */ - public fireMessage(msg: InternalMessage) { + public fireMessage( + msg: EMMessage | EMMessageResultSuccess | EMMessageResultError + ) { if (!msg.id) { msg.id = ++this.msgId; } @@ -82,6 +96,43 @@ export class ExternalMessaging { console.log("Receiving message from external app", msg); } + if (msg.type === "command") { + if (!this.connection) { + // eslint-disable-next-line no-console + console.warn("Received command without having connection set", msg); + this.fireMessage({ + id: msg.id, + type: "result", + success: false, + error: { + code: "commands_not_init", + message: `Commands connection not set`, + }, + }); + } else if (msg.command === "restart") { + this.connection.socket.close(); + this.fireMessage({ + id: msg.id, + type: "result", + success: true, + result: null, + }); + } else { + // eslint-disable-next-line no-console + console.warn("Received unknown command", msg.command, msg); + this.fireMessage({ + id: msg.id, + type: "result", + success: false, + error: { + code: "unknown_command", + message: `Unknown command ${msg.command}`, + }, + }); + } + return; + } + const pendingCmd = this.commands[msg.id]; if (!pendingCmd) { @@ -99,7 +150,7 @@ export class ExternalMessaging { } } - protected _sendExternal(msg: InternalMessage) { + protected _sendExternal(msg: EMMessage) { if (__DEV__) { // eslint-disable-next-line no-console console.log("Sending message to external app", msg); diff --git a/src/layouts/hass-router-page.ts b/src/layouts/hass-router-page.ts index 5c37cd577c..6fb01e521f 100644 --- a/src/layouts/hass-router-page.ts +++ b/src/layouts/hass-router-page.ts @@ -127,7 +127,9 @@ export class HassRouterPage extends ReactiveElement { // Update the url if we know where we're mounted. if (route) { - navigate(`${route.prefix}/${result}`, { replace: true }); + navigate(`${route.prefix}/${result}${location.search}`, { + replace: true, + }); } } } diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index bb452d1781..e3bf2f9d8b 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -51,7 +51,9 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { const path = curPath(); if (["", "/"].includes(path)) { - navigate(`/${getStorageDefaultPanelUrlPath()}`, { replace: true }); + navigate(`/${getStorageDefaultPanelUrlPath()}${location.search}`, { + replace: true, + }); } this._route = { prefix: "", diff --git a/src/panels/config/automation/condition/ha-automation-condition-editor.ts b/src/panels/config/automation/condition/ha-automation-condition-editor.ts index 5370df85ba..e7977694f3 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-editor.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-editor.ts @@ -138,7 +138,8 @@ export default class HaAutomationConditionEditor extends LitElement { if (!ev.detail.isValid) { return; } - fireEvent(this, "value-changed", { value: ev.detail.value }); + // @ts-ignore + fireEvent(this, "value-changed", { value: ev.detail.value, yaml: true }); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/automation/condition/ha-automation-condition-row.ts b/src/panels/config/automation/condition/ha-automation-condition-row.ts index d83c454488..3e792abd18 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-row.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-row.ts @@ -109,6 +109,7 @@ export default class HaAutomationConditionRow extends LitElement { : ""} ) { switch (ev.detail.index) { case 0: diff --git a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts index 7db893f8fe..55b61d832a 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts @@ -291,6 +291,7 @@ export default class HaAutomationTriggerRow extends LitElement { if (!ev.detail.isValid) { return; } + this._warnings = undefined; fireEvent(this, "value-changed", { value: ev.detail.value }); } diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 5e033fcf4c..a03936a2c6 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -131,7 +131,7 @@ class HaConfigDashboard extends LitElement { border-bottom: var(--app-header-border-bottom); --header-height: 55px; } - ha-card:last-child { + :host(:not([narrow])) ha-card:last-child { margin-bottom: 24px; } ha-config-section { @@ -152,7 +152,7 @@ class HaConfigDashboard extends LitElement { padding-bottom: 0; } :host([narrow]) ha-card { - background-color: var(--primary-background-color); + border-radius: 0; box-shadow: unset; } diff --git a/src/panels/config/dashboard/ha-config-navigation.ts b/src/panels/config/dashboard/ha-config-navigation.ts index a076385d10..5f29dadc89 100644 --- a/src/panels/config/dashboard/ha-config-navigation.ts +++ b/src/panels/config/dashboard/ha-config-navigation.ts @@ -43,8 +43,7 @@ class HaConfigNavigation extends LitElement { ${page.name || this.hass.localize( - page.translationKey || - `ui.panel.config.${page.component}.caption` + `ui.panel.config.dashboard.${page.translationKey}.title` )} ${page.component === "cloud" && (page.info as CloudStatus) ? page.info.logged_in @@ -68,7 +67,7 @@ class HaConfigNavigation extends LitElement {
${page.description || this.hass.localize( - `ui.panel.config.${page.component}.description` + `ui.panel.config.dashboard.${page.translationKey}.description` )}
`} diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index 9b1a3243db..02d9068b20 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -49,80 +49,69 @@ export const configSections: { [name: string]: PageNavigation[] } = { dashboard: [ { path: "/config/integrations", - name: "Devices & Services", - description: "Integrations, devices, entities and areas", + translationKey: "devices", iconPath: mdiDevices, iconColor: "#0D47A1", core: true, }, { path: "/config/automation", - name: "Automations & Scenes", - description: "Manage automations, scenes, scripts and helpers", + translationKey: "automations", iconPath: mdiRobot, iconColor: "#518C43", core: true, }, { path: "/config/blueprint", - name: "Blueprints", - description: "Manage blueprints", + translationKey: "blueprints", iconPath: mdiPaletteSwatch, iconColor: "#64B5F6", component: "blueprint", }, { path: "/hassio", - name: "Add-ons, Backups & Supervisor", - description: "Create backups, check logs or reboot your system", + translationKey: "supervisor", iconPath: mdiHomeAssistant, iconColor: "#4084CD", component: "hassio", }, { path: "/config/lovelace/dashboards", - name: "Dashboards", - description: "Create customized sets of cards to control your home", + translationKey: "dashboards", iconPath: mdiViewDashboard, iconColor: "#B1345C", component: "lovelace", }, { path: "/config/energy", - name: "Energy", - description: "Monitor your energy production and consumption", + translationKey: "energy", iconPath: mdiLightningBolt, iconColor: "#F1C447", component: "energy", }, { path: "/config/tags", - name: "Tags", - description: - "Trigger automations when a NFC tag, QR code, etc. is scanned", + translationKey: "tags", iconPath: mdiNfcVariant, iconColor: "#616161", component: "tag", }, { path: "/config/person", - name: "People & Zones", - description: "Manage the people and zones that Home Assistant tracks", + translationKey: "people", iconPath: mdiAccount, iconColor: "#E48629", components: ["person", "zone", "users"], }, { path: "#external-app-configuration", - name: "Companion App", - description: "Location and notifications", + translationKey: "companion", iconPath: mdiCellphoneCog, iconColor: "#8E24AA", }, { path: "/config/core", - name: "Settings", - description: "Basic settings, server controls, logs and info", + translationKey: "settings", iconPath: mdiCog, iconColor: "#4A5963", core: true, diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts index 151350351d..cc4cdda74e 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts @@ -1,5 +1,4 @@ import "@material/mwc-button/mwc-button"; -import type { TextField } from "@material/mwc-textfield/mwc-textfield"; import "@material/mwc-textfield/mwc-textfield"; import { mdiAlertCircle, mdiCheckCircle, mdiQrcodeScan } from "@mdi/js"; import "@polymer/paper-input/paper-input"; @@ -183,17 +182,9 @@ class DialogZWaveJSAddNode extends LitElement { .localize=${this.hass.localize} @qr-code-scanned=${this._qrCodeScanned} > -

- If scanning doesn't work, you can enter the QR code value - manually: -

- ` + + ${this.hass.localize("ui.panel.config.zwave_js.common.back")} + ` : this._status === "validate_dsk_enter_pin" ? html`

@@ -274,7 +265,7 @@ class DialogZWaveJSAddNode extends LitElement { We have not found any device in inclusion mode. Make sure the device is active and in inclusion mode.

- + Retry ` @@ -373,7 +364,7 @@ class DialogZWaveJSAddNode extends LitElement { - ${this.hass.localize("ui.panel.config.zwave_js.common.close")} + ${this.hass.localize("ui.common.close")} ` : this._status === "failed" @@ -510,15 +501,6 @@ class DialogZWaveJSAddNode extends LitElement { this._status = "qr_scan"; } - private _qrKeyDown(ev: KeyboardEvent) { - if (this._qrProcessing) { - return; - } - if (ev.key === "Enter") { - this._handleQrCodeScanned((ev.target as TextField).value); - } - } - private _qrCodeScanned(ev: CustomEvent): void { if (this._qrProcessing) { return; @@ -574,11 +556,7 @@ class DialogZWaveJSAddNode extends LitElement { } } else if (provisioningInfo.version === 0) { this._inclusionStrategy = InclusionStrategy.Security_S2; - // this._startInclusion(provisioningInfo); - this._startInclusion(undefined, undefined, { - dsk: "34673-15546-46480-39591-32400-22155-07715-45994", - security_classes: [0, 1, 7], - }); + this._startInclusion(provisioningInfo); } else { this._error = "This QR code is not supported"; this._status = "failed"; @@ -636,6 +614,11 @@ class DialogZWaveJSAddNode extends LitElement { ZWaveFeature.SmartStart ) ).supported; + this._supportsSmartStart = true; + } + + private _startOver(_ev: Event) { + this._startInclusion(); } private _startInclusion( diff --git a/src/panels/config/users/dialog-user-detail.ts b/src/panels/config/users/dialog-user-detail.ts index 3809131a65..f8d10d5ab7 100644 --- a/src/panels/config/users/dialog-user-detail.ts +++ b/src/panels/config/users/dialog-user-detail.ts @@ -106,6 +106,7 @@ class DialogUserDetail extends LitElement { .dir=${computeRTLDirection(this.hass)} > diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index 9c52a70ac8..6a664ee61b 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -18,6 +18,7 @@ import "../../../components/ha-code-editor"; import "../../../components/ha-icon-button"; import "../../../components/ha-svg-icon"; import "../../../components/ha-checkbox"; +import "../../../components/ha-expansion-panel"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { EventsMixin } from "../../../mixins/events-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin"; @@ -40,6 +41,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { padding: 16px; } + ha-expansion-panel { + margin: 0 8px 16px; + } + .inputs { width: 100%; max-width: 400px; @@ -135,72 +140,72 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { padding: 0; } - -

- [[localize('ui.panel.developer-tools.tabs.states.description1')]]
- [[localize('ui.panel.developer-tools.tabs.states.description2')]] -

-
-
- - -

- [[localize('ui.panel.developer-tools.tabs.states.state_attributes')]] -

- -
- [[localize('ui.panel.developer-tools.tabs.states.set_state')]] - -
-
-
- -
-
-

[[localize('ui.panel.developer-tools.tabs.states.current_entities')]]

+ +

+ [[localize('ui.panel.developer-tools.tabs.states.description1')]]
+ [[localize('ui.panel.developer-tools.tabs.states.description2')]] +

+
+
+ + +

+ [[localize('ui.panel.developer-tools.tabs.states.state_attributes')]] +

+ +
+ [[localize('ui.panel.developer-tools.tabs.states.set_state')]] + +
+
+
+ +
+
+
diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 61445901d7..fa572585cb 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -698,7 +698,7 @@ class HUIRoot extends LitElement { private _navigateToView(path: string | number, replace?: boolean) { if (!this.lovelace!.editMode) { - navigate(`${this.route!.prefix}/${path}`, { replace }); + navigate(`${this.route!.prefix}/${path}${location.search}`, { replace }); return; } navigate(`${this.route!.prefix}/${path}?${addSearchParam({ edit: "1" })}`, { diff --git a/src/state/external-mixin.ts b/src/state/external-mixin.ts new file mode 100644 index 0000000000..4bc48e5faf --- /dev/null +++ b/src/state/external-mixin.ts @@ -0,0 +1,15 @@ +import { Constructor } from "../types"; +import { HassBaseEl } from "./hass-base-mixin"; + +export const ExternalMixin = >( + superClass: T +) => + class extends superClass { + protected hassConnected() { + super.hassConnected(); + + if (this.hass!.auth.external) { + this.hass!.auth.external.connection = this.hass!.connection; + } + } + }; diff --git a/src/state/hass-element.ts b/src/state/hass-element.ts index 7a24238c23..1a8a6f3999 100644 --- a/src/state/hass-element.ts +++ b/src/state/hass-element.ts @@ -6,6 +6,7 @@ import DisconnectToastMixin from "./disconnect-toast-mixin"; import { hapticMixin } from "./haptic-mixin"; import { HassBaseEl } from "./hass-base-mixin"; import { loggingMixin } from "./logging-mixin"; +import { ExternalMixin } from "./external-mixin"; import MoreInfoMixin from "./more-info-mixin"; import NotificationMixin from "./notification-mixin"; import { panelTitleMixin } from "./panel-title-mixin"; @@ -31,4 +32,5 @@ export class HassElement extends ext(HassBaseEl, [ hapticMixin, panelTitleMixin, loggingMixin, + ExternalMixin, ]) {} diff --git a/src/state/themes-mixin.ts b/src/state/themes-mixin.ts index bb5c443a62..3595a54a59 100644 --- a/src/state/themes-mixin.ts +++ b/src/state/themes-mixin.ts @@ -131,5 +131,7 @@ export default >(superClass: T) => (themeMeta.getAttribute("default-content") as string); themeMeta.setAttribute("content", themeColor); } + + this.hass!.auth.external?.fireMessage({ type: "theme-update" }); } }; diff --git a/src/translations/en.json b/src/translations/en.json index 5c25d8c494..f4ac593a0c 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -928,9 +928,47 @@ }, "config": { "header": "Configure Home Assistant", - "advanced_mode": { - "hint_enable": "Missing config options? Enable advanced mode on", - "link_profile_page": "your profile page" + "dashboard": { + "devices": { + "title": "Devices & Services", + "description": "Integrations, devices, entities and areas" + }, + "automations": { + "title": "Automations & Scenes", + "description": "Manage automations, scenes, scripts and helpers" + }, + "blueprints": { + "title": "Blueprints", + "description": "Manage blueprints" + }, + "supervisor": { + "title": "Add-ons, Backups & Supervisor", + "description": "Create backups, check logs or reboot your system" + }, + "dashboards": { + "title": "Dashboards", + "description": "Create customized sets of cards to control your home" + }, + "energy": { + "title": "Energy", + "description": "Monitor your energy production and consumption" + }, + "tags": { + "title": "Tags", + "description": "Trigger automations when a NFC tag, QR code, etc. is scanned" + }, + "people": { + "title": "People & Zones", + "description": "Manage the people and zones that Home Assistant tracks" + }, + "companion": { + "title": "Companion App", + "description": "Location and notifications" + }, + "settings": { + "title": "Settings", + "description": "Basic settings, server controls, logs and info" + } }, "common": { "editor": { @@ -2813,7 +2851,7 @@ "node_id": "Device ID", "home_id": "Home ID", "source": "Source", - "close": "Close", + "back": "Back", "add_node": "Add device", "remove_node": "Remove device", "reconfigure_server": "Re-configure Server", diff --git a/test/external_app/external_messaging.spec.ts b/test/external_app/external_messaging.spec.ts index 0903704572..6f3a3e2733 100644 --- a/test/external_app/external_messaging.spec.ts +++ b/test/external_app/external_messaging.spec.ts @@ -2,16 +2,16 @@ import { assert } from "chai"; import { ExternalMessaging, - InternalMessage, + EMMessage, } from "../../src/external_app/external_messaging"; // @ts-ignore global.__DEV__ = true; class MockExternalMessaging extends ExternalMessaging { - public mockSent: InternalMessage[] = []; + public mockSent: EMMessage[] = []; - protected _sendExternal(msg: InternalMessage) { + protected _sendExternal(msg: EMMessage) { this.mockSent.push(msg); } }