Merge pull request #5135 from home-assistant/dev

20200311.1
This commit is contained in:
Bram Kragten 2020-03-11 19:07:22 +01:00 committed by GitHub
commit 2784edc689
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 54 additions and 72 deletions

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -291,16 +291,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "13:21", state: "13:21",
attributes: { attributes: {
attribution: "Data provided by Ring.com", attribution: "Data provided by Ring.com",
device_id: "e04f434dca02",
firmware: "Up to Date",
kind: "lpd_v2",
timezone: "America/New_York",
type: "doorbots",
wifi_name: "RingOfSecurity-hUrGKNlhR",
created_at: "2019-01-22T13:21:03-05:00",
answered: false, answered: false,
recording_status: "ready",
category: "motion",
friendly_name: "Front Door Last Motion", friendly_name: "Front Door Last Motion",
icon: "hademo:history", icon: "hademo:history",
}, },
@ -313,8 +304,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"cbd8dfac9efb441f19168e271cb8629b0372d0c1f721353394b23ed0202013b0", "cbd8dfac9efb441f19168e271cb8629b0372d0c1f721353394b23ed0202013b0",
motion_detection: true, motion_detection: true,
friendly_name: "Patio", friendly_name: "Patio",
entity_picture: entity_picture: "/assets/arsaboo/images/camera.patio.jpg",
"/api/camera_proxy/camera.patio?token=cbd8dfac9efb441f19168e271cb8629b0372d0c1f721353394b23ed0202013b0",
supported_features: 0, supported_features: 0,
}, },
}, },
@ -326,8 +316,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"479b332e0a7cad4c58e0fb98a1ecb7942e3b225190adb93a1341edfa7daf45b0", "479b332e0a7cad4c58e0fb98a1ecb7942e3b225190adb93a1341edfa7daf45b0",
motion_detection: true, motion_detection: true,
friendly_name: "Porch", friendly_name: "Porch",
entity_picture: entity_picture: "/assets/arsaboo/images/camera.porch.jpg",
"/api/camera_proxy/camera.porch?token=479b332e0a7cad4c58e0fb98a1ecb7942e3b225190adb93a1341edfa7daf45b0",
supported_features: 0, supported_features: 0,
}, },
}, },
@ -339,8 +328,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"9381b2e4edd1bb21e868e2193f5d132a5fae153ce4f458451d979a02712b4642", "9381b2e4edd1bb21e868e2193f5d132a5fae153ce4f458451d979a02712b4642",
motion_detection: true, motion_detection: true,
friendly_name: "Backyard", friendly_name: "Backyard",
entity_picture: entity_picture: "/assets/arsaboo/images/camera.backyard.jpg",
"/api/camera_proxy/camera.backyard?token=9381b2e4edd1bb21e868e2193f5d132a5fae153ce4f458451d979a02712b4642",
supported_features: 0, supported_features: 0,
}, },
}, },
@ -352,8 +340,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"ac38bf88c2c5896eed66ae15739a3e726677f92d79e0d57f83f726ac28bda746", "ac38bf88c2c5896eed66ae15739a3e726677f92d79e0d57f83f726ac28bda746",
motion_detection: true, motion_detection: true,
friendly_name: "Driveway", friendly_name: "Driveway",
entity_picture: entity_picture: "/assets/arsaboo/images/camera.driveway.jpg",
"/api/camera_proxy/camera.driveway?token=ac38bf88c2c5896eed66ae15739a3e726677f92d79e0d57f83f726ac28bda746",
supported_features: 0, supported_features: 0,
}, },
}, },
@ -477,8 +464,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
friendly_name: localize( friendly_name: localize(
"ui.panel.page-demo.config.arsaboo.names.family_room" "ui.panel.page-demo.config.arsaboo.names.family_room"
), ),
entity_picture: entity_picture: "/assets/arsaboo/images/media_player_family_room.jpg",
"/api/media_player_proxy/media_player.family_room_2?token=be41a86e2a360761d67c36a010b09654b730deec092016ee92aafef79b1978ff&cache=e03d22fb103202e7",
supported_features: 64063, supported_features: 64063,
}, },
}, },
@ -487,16 +473,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "06:44", state: "06:44",
attributes: { attributes: {
attribution: "Data provided by Ring.com", attribution: "Data provided by Ring.com",
device_id: "e04f434dca02",
firmware: "Up to Date",
kind: "lpd_v2",
timezone: "America/New_York",
type: "doorbots",
wifi_name: "RingOfSecurity-hUrGKNlhR",
created_at: "2019-01-22T06:44:31-05:00",
answered: false, answered: false,
recording_status: "ready",
category: "ding",
friendly_name: "Front Door Last Ding", friendly_name: "Front Door Last Ding",
icon: "hademo:history", icon: "hademo:history",
}, },

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name="home-assistant-frontend", name="home-assistant-frontend",
version="20200311.0", version="20200311.1",
description="The Home Assistant frontend", description="The Home Assistant frontend",
url="https://github.com/home-assistant/home-assistant-polymer", url="https://github.com/home-assistant/home-assistant-polymer",
author="The Home Assistant Authors", author="The Home Assistant Authors",

View File

@ -53,7 +53,7 @@ class HaCameraStream extends LitElement {
<img <img
@load=${this._elementResized} @load=${this._elementResized}
.src=${__DEMO__ .src=${__DEMO__
? `/api/camera_proxy_stream/${this.stateObj.entity_id}` ? this.stateObj!.attributes.entity_picture
: computeMJPEGStreamUrl(this.stateObj)} : computeMJPEGStreamUrl(this.stateObj)}
.alt=${`Preview of the ${computeStateName( .alt=${`Preview of the ${computeStateName(
this.stateObj this.stateObj

View File

@ -36,12 +36,17 @@ export class HaEventTrigger extends LitElement implements TriggerElement {
)} )}
.name=${"event_data"} .name=${"event_data"}
.defaultValue=${event_data} .defaultValue=${event_data}
@value-changed=${this._valueChanged} @value-changed=${this._dataChanged}
></ha-yaml-editor> ></ha-yaml-editor>
`; `;
} }
private _valueChanged(ev: CustomEvent): void { private _valueChanged(ev: CustomEvent): void {
ev.stopPropagation();
handleChangeEvent(this, ev);
}
private _dataChanged(ev: CustomEvent): void {
ev.stopPropagation(); ev.stopPropagation();
if (!ev.detail.isValid) { if (!ev.detail.isValid) {
return; return;

View File

@ -362,6 +362,9 @@ export class HuiEditView extends LitElement {
paper-spinner[active] { paper-spinner[active] {
display: block; display: block;
} }
paper-dialog-scrollable {
margin-top: 0;
}
.hidden { .hidden {
display: none; display: none;
} }

View File

@ -8,11 +8,11 @@ import {
CSSResult, CSSResult,
css, css,
} from "lit-element"; } from "lit-element";
import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item";
import "@polymer/paper-item/paper-item-body";
import { HomeAssistant } from "../../../../types"; import { HomeAssistant } from "../../../../types";
import { fireEvent } from "../../../../common/dom/fire_event"; import { fireEvent } from "../../../../common/dom/fire_event";
import { configElementStyle } from "../config-elements/config-elements-style";
import { LovelaceViewConfig, ShowViewConfig } from "../../../../data/lovelace"; import { LovelaceViewConfig, ShowViewConfig } from "../../../../data/lovelace";
import { fetchUsers, User } from "../../../../data/user"; import { fetchUsers, User } from "../../../../data/user";
@ -42,16 +42,14 @@ export class HuiViewVisibilityEditor extends LitElement {
@property() private _visible!: boolean | ShowViewConfig[]; @property() private _visible!: boolean | ShowViewConfig[];
private _sortedUsers = memoizeOne((users: User[]) => { private _sortedUsers = memoizeOne((users: User[]) => {
return users return users.sort((a, b) => compare(a.name, b.name));
.filter((user) => !user.system_generated)
.sort((a, b) => compare(a.name, b.name));
}); });
protected firstUpdated(changedProps: PropertyValues) { protected firstUpdated(changedProps: PropertyValues) {
super.firstUpdated(changedProps); super.firstUpdated(changedProps);
fetchUsers(this.hass).then((users) => { fetchUsers(this.hass).then((users) => {
this._users = users; this._users = users.filter((user) => !user.system_generated);
fireEvent(this, "iron-resize"); fireEvent(this, "iron-resize");
}); });
} }
@ -62,24 +60,23 @@ export class HuiViewVisibilityEditor extends LitElement {
} }
return html` return html`
${configElementStyle} <p>
<div class="card-config"> ${this.hass.localize(
<span>Select which users should have access to this view</span> "ui.panel.lovelace.editor.edit_view.visibility.select_users"
${this._sortedUsers(this._users).map(
(user) => html`
<div class="flex">
<div>${user.name}</div>
<ha-switch
.userId="${user.id}"
@change=${this.valChange}
.checked=${this.checkUser(user.id)}
>&nbsp;</ha-switch
>
</div>
`
)} )}
</div> </p>
${this._sortedUsers(this._users).map(
(user) => html`
<paper-item>
<paper-item-body>${user.name}</paper-item-body>
<ha-switch
.userId="${user.id}"
@change=${this.valChange}
.checked=${this.checkUser(user.id)}
></ha-switch>
</paper-item>
`
)}
`; `;
} }
@ -133,13 +130,8 @@ export class HuiViewVisibilityEditor extends LitElement {
static get styles(): CSSResult { static get styles(): CSSResult {
return css` return css`
.flex { :host {
flex: 1; display: block;
margin-left: 16px;
display: flex;
justify-content: space-between;
align-items: center;
min-width: 0;
} }
`; `;
} }

View File

@ -166,21 +166,23 @@ class LovelaceFullConfigEditor extends LitElement {
} }
} }
private _closeEditor() { private async _closeEditor() {
if (this._changed) { if (
showConfirmationDialog(this, { this._changed &&
!(await showConfirmationDialog(this, {
text: this.hass.localize( text: this.hass.localize(
"ui.panel.lovelace.editor.raw_editor.confirm_unsaved_changes" "ui.panel.lovelace.editor.raw_editor.confirm_unsaved_changes"
), ),
dismissText: this.hass!.localize("ui.common.no"), dismissText: this.hass!.localize("ui.common.no"),
confirmText: this.hass!.localize("ui.common.yes"), confirmText: this.hass!.localize("ui.common.yes"),
confirm: () => { }))
window.onbeforeunload = null; ) {
if (this.closeEditor) { return;
this.closeEditor(); }
}
}, window.onbeforeunload = null;
}); if (this.closeEditor) {
this.closeEditor();
} }
} }

View File

@ -1929,7 +1929,10 @@
"move_right": "Move view right", "move_right": "Move view right",
"tab_settings": "Settings", "tab_settings": "Settings",
"tab_badges": "Badges", "tab_badges": "Badges",
"tab_visibility": "Visibility" "tab_visibility": "Visibility",
"visibility": {
"select_users": "Select which users should see this view in the navigation"
}
}, },
"edit_card": { "edit_card": {
"header": "Card Configuration", "header": "Card Configuration",