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",
attributes: {
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,
recording_status: "ready",
category: "motion",
friendly_name: "Front Door Last Motion",
icon: "hademo:history",
},
@ -313,8 +304,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"cbd8dfac9efb441f19168e271cb8629b0372d0c1f721353394b23ed0202013b0",
motion_detection: true,
friendly_name: "Patio",
entity_picture:
"/api/camera_proxy/camera.patio?token=cbd8dfac9efb441f19168e271cb8629b0372d0c1f721353394b23ed0202013b0",
entity_picture: "/assets/arsaboo/images/camera.patio.jpg",
supported_features: 0,
},
},
@ -326,8 +316,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"479b332e0a7cad4c58e0fb98a1ecb7942e3b225190adb93a1341edfa7daf45b0",
motion_detection: true,
friendly_name: "Porch",
entity_picture:
"/api/camera_proxy/camera.porch?token=479b332e0a7cad4c58e0fb98a1ecb7942e3b225190adb93a1341edfa7daf45b0",
entity_picture: "/assets/arsaboo/images/camera.porch.jpg",
supported_features: 0,
},
},
@ -339,8 +328,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"9381b2e4edd1bb21e868e2193f5d132a5fae153ce4f458451d979a02712b4642",
motion_detection: true,
friendly_name: "Backyard",
entity_picture:
"/api/camera_proxy/camera.backyard?token=9381b2e4edd1bb21e868e2193f5d132a5fae153ce4f458451d979a02712b4642",
entity_picture: "/assets/arsaboo/images/camera.backyard.jpg",
supported_features: 0,
},
},
@ -352,8 +340,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"ac38bf88c2c5896eed66ae15739a3e726677f92d79e0d57f83f726ac28bda746",
motion_detection: true,
friendly_name: "Driveway",
entity_picture:
"/api/camera_proxy/camera.driveway?token=ac38bf88c2c5896eed66ae15739a3e726677f92d79e0d57f83f726ac28bda746",
entity_picture: "/assets/arsaboo/images/camera.driveway.jpg",
supported_features: 0,
},
},
@ -477,8 +464,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
friendly_name: localize(
"ui.panel.page-demo.config.arsaboo.names.family_room"
),
entity_picture:
"/api/media_player_proxy/media_player.family_room_2?token=be41a86e2a360761d67c36a010b09654b730deec092016ee92aafef79b1978ff&cache=e03d22fb103202e7",
entity_picture: "/assets/arsaboo/images/media_player_family_room.jpg",
supported_features: 64063,
},
},
@ -487,16 +473,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "06:44",
attributes: {
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,
recording_status: "ready",
category: "ding",
friendly_name: "Front Door Last Ding",
icon: "hademo:history",
},

View File

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

View File

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

View File

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

View File

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

View File

@ -8,11 +8,11 @@ import {
CSSResult,
css,
} 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 { fireEvent } from "../../../../common/dom/fire_event";
import { configElementStyle } from "../config-elements/config-elements-style";
import { LovelaceViewConfig, ShowViewConfig } from "../../../../data/lovelace";
import { fetchUsers, User } from "../../../../data/user";
@ -42,16 +42,14 @@ export class HuiViewVisibilityEditor extends LitElement {
@property() private _visible!: boolean | ShowViewConfig[];
private _sortedUsers = memoizeOne((users: User[]) => {
return users
.filter((user) => !user.system_generated)
.sort((a, b) => compare(a.name, b.name));
return users.sort((a, b) => compare(a.name, b.name));
});
protected firstUpdated(changedProps: PropertyValues) {
super.firstUpdated(changedProps);
fetchUsers(this.hass).then((users) => {
this._users = users;
this._users = users.filter((user) => !user.system_generated);
fireEvent(this, "iron-resize");
});
}
@ -62,24 +60,23 @@ export class HuiViewVisibilityEditor extends LitElement {
}
return html`
${configElementStyle}
<div class="card-config">
<span>Select which users should have access to this view</span>
${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>
`
<p>
${this.hass.localize(
"ui.panel.lovelace.editor.edit_view.visibility.select_users"
)}
</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 {
return css`
.flex {
flex: 1;
margin-left: 16px;
display: flex;
justify-content: space-between;
align-items: center;
min-width: 0;
:host {
display: block;
}
`;
}

View File

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

View File

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