mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-31 03:50:26 +00:00
Compare commits
13 Commits
fix-number
...
20210127.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b4e5740050 | ||
![]() |
12bb3f5796 | ||
![]() |
ff62fdb69d | ||
![]() |
4ebf32cb1f | ||
![]() |
5afb8a77a9 | ||
![]() |
48ed33af95 | ||
![]() |
4a64cd4464 | ||
![]() |
8ae1a1b558 | ||
![]() |
ef1dd8b761 | ||
![]() |
3766f44787 | ||
![]() |
178605664e | ||
![]() |
0cf8004b8d | ||
![]() |
00412c7216 |
1
.github/workflows/release.yaml
vendored
1
.github/workflows/release.yaml
vendored
@@ -33,6 +33,7 @@ jobs:
|
||||
|
||||
- name: Build and release package
|
||||
run: |
|
||||
python3 -m pip install twine
|
||||
export TWINE_USERNAME="__token__"
|
||||
export TWINE_PASSWORD="${{ secrets.TWINE_TOKEN }}"
|
||||
|
||||
|
2
setup.py
2
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name="home-assistant-frontend",
|
||||
version="20210127.0",
|
||||
version="20210127.2",
|
||||
description="The Home Assistant frontend",
|
||||
url="https://github.com/home-assistant/home-assistant-polymer",
|
||||
author="The Home Assistant Authors",
|
||||
|
@@ -202,9 +202,8 @@ export class HaForm extends LitElement implements HaFormElement {
|
||||
ev.stopPropagation();
|
||||
const schema = (ev.target as HaFormElement).schema as HaFormSchema;
|
||||
const data = this.data as HaFormDataContainer;
|
||||
data[schema.name] = ev.detail.value;
|
||||
fireEvent(this, "value-changed", {
|
||||
value: { ...data },
|
||||
value: { ...data, [schema.name]: ev.detail.value },
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -9,4 +9,4 @@ export const convertTextToSpeech = (
|
||||
language?: string;
|
||||
options?: Record<string, unknown>;
|
||||
}
|
||||
) => hass.callApi<{ url: string }>("POST", "tts_get_url", data);
|
||||
) => hass.callApi<{ url: string; path: string }>("POST", "tts_get_url", data);
|
||||
|
@@ -78,6 +78,9 @@ export class MoreInfoDialog extends LitElement {
|
||||
}
|
||||
|
||||
protected shouldShowEditIcon(domain, stateObj): boolean {
|
||||
if (__DEMO__) {
|
||||
return false;
|
||||
}
|
||||
if (EDITABLE_DOMAINS_WITH_ID.includes(domain) && stateObj.attributes.id) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light";
|
||||
import "@polymer/paper-item/paper-item";
|
||||
import "@polymer/paper-listbox/paper-listbox";
|
||||
import "@material/mwc-button";
|
||||
import { mdiPlayCircleOutline } from "@mdi/js";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
@@ -59,12 +58,6 @@ export class CloudTTSPref extends LitElement {
|
||||
<ha-card
|
||||
header=${this.hass.localize("ui.panel.config.cloud.account.tts.title")}
|
||||
>
|
||||
<div class="example">
|
||||
<mwc-button @click=${this._openTryDialog}>
|
||||
<ha-svg-icon .path=${mdiPlayCircleOutline}></ha-svg-icon>
|
||||
${this.hass.localize("ui.panel.config.cloud.account.tts.try")}
|
||||
</mwc-button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.cloud.account.tts.info",
|
||||
@@ -112,6 +105,11 @@ export class CloudTTSPref extends LitElement {
|
||||
</paper-listbox>
|
||||
</paper-dropdown-menu-light>
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<mwc-button @click=${this._openTryDialog}>
|
||||
${this.hass.localize("ui.panel.config.cloud.account.tts.try")}
|
||||
</mwc-button>
|
||||
</div>
|
||||
</ha-card>
|
||||
`;
|
||||
}
|
||||
|
@@ -164,7 +164,7 @@ export class DialogTryTts extends LitElement {
|
||||
language,
|
||||
options: { gender },
|
||||
});
|
||||
url = result.url;
|
||||
url = result.path;
|
||||
} catch (err) {
|
||||
this._loadingExample = false;
|
||||
showAlertDialog(this, {
|
||||
|
@@ -149,7 +149,7 @@ class DialogDeviceRegistryDetail extends LitElement {
|
||||
area_id: this._areaId || null,
|
||||
disabled_by: this._disabledBy || null,
|
||||
});
|
||||
this._params = undefined;
|
||||
this.closeDialog();
|
||||
} catch (err) {
|
||||
this._error =
|
||||
err.message ||
|
||||
|
@@ -37,8 +37,7 @@ import { showAlertDialog } from "../../../../../dialogs/generic/show-dialog-box"
|
||||
import { computeStateName } from "../../../../../common/entity/compute_state_name";
|
||||
import {
|
||||
computeDeviceName,
|
||||
DeviceRegistryEntry,
|
||||
fetchDeviceRegistry,
|
||||
subscribeDeviceRegistry,
|
||||
} from "../../../../../data/device_registry";
|
||||
|
||||
@customElement("zwave-migration")
|
||||
@@ -53,8 +52,6 @@ export class ZwaveMigration extends LitElement {
|
||||
|
||||
@internalProperty() private _networkStatus?: ZWaveNetworkStatus;
|
||||
|
||||
@internalProperty() private _unsub?: Promise<UnsubscribeFunc>;
|
||||
|
||||
@internalProperty() private _step = 0;
|
||||
|
||||
@internalProperty() private _stoppingNetwork = false;
|
||||
@@ -65,10 +62,18 @@ export class ZwaveMigration extends LitElement {
|
||||
|
||||
@internalProperty() private _migratedZwaveEntities?: string[];
|
||||
|
||||
@internalProperty() private _deviceRegistry?: DeviceRegistryEntry[];
|
||||
@internalProperty() private _deviceNameLookup: { [id: string]: string } = {};
|
||||
|
||||
private _unsub?: Promise<UnsubscribeFunc>;
|
||||
|
||||
private _unsubDevices?: UnsubscribeFunc;
|
||||
|
||||
public disconnectedCallback(): void {
|
||||
this._unsubscribe();
|
||||
if (this._unsubDevices) {
|
||||
this._unsubDevices();
|
||||
this._unsubDevices = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
@@ -89,7 +94,8 @@ export class ZwaveMigration extends LitElement {
|
||||
"ui.panel.config.zwave.migration.ozw.introduction"
|
||||
)}
|
||||
</div>
|
||||
${!this.hass.config.components.includes("mqtt")
|
||||
${!this.hass.config.components.includes("hassio") &&
|
||||
!this.hass.config.components.includes("mqtt")
|
||||
? html`
|
||||
<ha-card class="content" header="MQTT Required">
|
||||
<div class="card-content">
|
||||
@@ -277,9 +283,9 @@ export class ZwaveMigration extends LitElement {
|
||||
).map(
|
||||
(device_id) =>
|
||||
html`<li>
|
||||
${this._computeDeviceName(
|
||||
${this._deviceNameLookup[
|
||||
device_id
|
||||
)}
|
||||
] || device_id}
|
||||
</li>`
|
||||
)}
|
||||
</ul>`
|
||||
@@ -372,10 +378,7 @@ export class ZwaveMigration extends LitElement {
|
||||
|
||||
private async _setupOzw() {
|
||||
const ozwConfigFlow = await startOzwConfigFlow(this.hass);
|
||||
if (
|
||||
!this.hass.config.components.includes("hassio") &&
|
||||
this.hass.config.components.includes("ozw")
|
||||
) {
|
||||
if (this.hass.config.components.includes("ozw")) {
|
||||
this._getMigrationData();
|
||||
this._step = 3;
|
||||
return;
|
||||
@@ -399,18 +402,29 @@ export class ZwaveMigration extends LitElement {
|
||||
this._migrationData.migration_entity_map
|
||||
);
|
||||
if (Object.keys(this._migrationData.migration_device_map).length) {
|
||||
this._deviceRegistry = await fetchDeviceRegistry(this.hass);
|
||||
this._fetchDevices();
|
||||
}
|
||||
}
|
||||
|
||||
private _computeDeviceName(deviceId) {
|
||||
const device = this._deviceRegistry?.find(
|
||||
(devReg) => devReg.id === deviceId
|
||||
private _fetchDevices() {
|
||||
this._unsubDevices = subscribeDeviceRegistry(
|
||||
this.hass.connection,
|
||||
(devices) => {
|
||||
if (!this._migrationData) {
|
||||
return;
|
||||
}
|
||||
const migrationDevices = Object.keys(
|
||||
this._migrationData.migration_device_map
|
||||
);
|
||||
const deviceNameLookup = {};
|
||||
devices.forEach((device) => {
|
||||
if (migrationDevices.includes(device.id)) {
|
||||
deviceNameLookup[device.id] = computeDeviceName(device, this.hass);
|
||||
}
|
||||
});
|
||||
this._deviceNameLookup = deviceNameLookup;
|
||||
}
|
||||
);
|
||||
if (!device) {
|
||||
return deviceId;
|
||||
}
|
||||
return computeDeviceName(device, this.hass);
|
||||
}
|
||||
|
||||
private async _doMigrate() {
|
||||
|
@@ -96,8 +96,14 @@ export interface EditSubElementEvent {
|
||||
}
|
||||
|
||||
export const actionConfigStruct = dynamic((_value, ctx) => {
|
||||
const test = actionConfigMap[ctx.branch[0][ctx.path[0]].action];
|
||||
return test || actionConfigStructType;
|
||||
if (ctx.branch[0][ctx.path[0]]) {
|
||||
return (
|
||||
actionConfigMap[ctx.branch[0][ctx.path[0]].action] ||
|
||||
actionConfigStructType
|
||||
);
|
||||
}
|
||||
|
||||
return actionConfigStructType;
|
||||
});
|
||||
|
||||
const actionConfigStructUser = object({
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
||||
import { UNAVAILABLE } from "../../../data/entity";
|
||||
import { setValue } from "../../../data/input_text";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
||||
@@ -54,7 +54,7 @@ class HuiInputTextEntityRow extends LitElement implements LovelaceRow {
|
||||
<hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
|
||||
<paper-input
|
||||
no-label-float
|
||||
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state)}
|
||||
.disabled=${stateObj.state === UNAVAILABLE}
|
||||
.value="${stateObj.state}"
|
||||
.minlength="${stateObj.attributes.min}"
|
||||
.maxlength="${stateObj.attributes.max}"
|
||||
|
@@ -189,30 +189,6 @@ class HUIRoot extends LitElement {
|
||||
)}
|
||||
</mwc-list-item>
|
||||
`}
|
||||
<mwc-list-item
|
||||
graphic="icon"
|
||||
@request-selected="${this._handleManageDashboards}"
|
||||
>
|
||||
<ha-svg-icon
|
||||
slot="graphic"
|
||||
.path=${mdiViewDashboard}
|
||||
></ha-svg-icon>
|
||||
${this.hass!.localize(
|
||||
"ui.panel.lovelace.editor.menu.manage_dashboards"
|
||||
)}
|
||||
</mwc-list-item>
|
||||
<mwc-list-item
|
||||
graphic="icon"
|
||||
@request-selected="${this._handleManageResources}"
|
||||
>
|
||||
<ha-svg-icon
|
||||
slot="graphic"
|
||||
.path=${mdiFileMultiple}
|
||||
></ha-svg-icon>
|
||||
${this.hass!.localize(
|
||||
"ui.panel.lovelace.editor.menu.manage_resources"
|
||||
)}
|
||||
</mwc-list-item>
|
||||
<mwc-list-item
|
||||
graphic="icon"
|
||||
@request-selected="${this._handleRawEditor}"
|
||||
@@ -225,6 +201,35 @@ class HUIRoot extends LitElement {
|
||||
"ui.panel.lovelace.editor.menu.raw_editor"
|
||||
)}
|
||||
</mwc-list-item>
|
||||
${__DEMO__ /* No config available in the demo */
|
||||
? ""
|
||||
: html`<mwc-list-item
|
||||
graphic="icon"
|
||||
@request-selected="${this._handleManageDashboards}"
|
||||
>
|
||||
<ha-svg-icon
|
||||
slot="graphic"
|
||||
.path=${mdiViewDashboard}
|
||||
></ha-svg-icon>
|
||||
${this.hass!.localize(
|
||||
"ui.panel.lovelace.editor.menu.manage_dashboards"
|
||||
)}
|
||||
</mwc-list-item>
|
||||
${this.hass.userData?.showAdvanced
|
||||
? html`<mwc-list-item
|
||||
graphic="icon"
|
||||
@request-selected="${this
|
||||
._handleManageResources}"
|
||||
>
|
||||
<ha-svg-icon
|
||||
slot="graphic"
|
||||
.path=${mdiFileMultiple}
|
||||
></ha-svg-icon>
|
||||
${this.hass!.localize(
|
||||
"ui.panel.lovelace.editor.menu.manage_resources"
|
||||
)}
|
||||
</mwc-list-item>`
|
||||
: ""} `}
|
||||
</ha-button-menu>
|
||||
</app-toolbar>
|
||||
`
|
||||
|
@@ -774,7 +774,7 @@
|
||||
"edit_in_yaml_supported": "You can still edit your config in YAML.",
|
||||
"key_missing": "Required key \"{key}\" is missing.",
|
||||
"key_not_expected": "Key \"{key}\" is not expected or not supported by the visual editor.",
|
||||
"key_wrong_type": "The provided value for \"{key}\" is not supported by the visual editor editor. We support ({type_correct}) but received ({type_wrong})."
|
||||
"key_wrong_type": "The provided value for \"{key}\" is not supported by the visual editor. We support ({type_correct}) but received ({type_wrong})."
|
||||
}
|
||||
},
|
||||
"login-form": {
|
||||
@@ -2505,7 +2505,7 @@
|
||||
"cards": {
|
||||
"confirm_delete": "Are you sure you want to delete this card?",
|
||||
"actions": {
|
||||
"action_confirmation": "Are you sure you want to exectue action \"{action}\"?",
|
||||
"action_confirmation": "Are you sure you want to execute action \"{action}\"?",
|
||||
"no_entity_more_info": "No entity provided for more info dialog",
|
||||
"no_entity_toggle": "No entity provided to toggle",
|
||||
"no_navigation_path": "No navigation path specified",
|
||||
|
Reference in New Issue
Block a user