Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="home-assistant-frontend",
version="20191204.0",
version="20191204.1",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/home-assistant-polymer",
author="The Home Assistant Authors",
Expand Down
7 changes: 4 additions & 3 deletions src/panels/config/automation/thingtalk/dialog-thingtalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,19 @@ class DialogThingtalk extends LitElement {
if (devices.length === 1) {
Object.entries(devices[0]).forEach(([field, value]) => {
this._config[type][index][field] = value;
return;
});
return;
}
const automation = { ...this._config[type][index] };
delete this._config[type][index];
const newAutomations: any[] = [];
devices.forEach((fields) => {
const newAutomation = { ...automation };
Object.entries(fields).forEach(([field, value]) => {
newAutomation[field] = value;
});
this._config[type].push(newAutomation);
newAutomations.push(newAutomation);
});
this._config[type].splice(index, 1, ...newAutomations);
});
});
this._sendConfig(this._value, this._config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class CloudGoogleAssistant extends LitElement {
() => {
showToast(parent, {
message: this.hass!.localize(
"ui.panel.config.cloud.googe.sync_to_google"
"ui.panel.config.cloud.google.sync_to_google"
),
});
cloudSyncGoogleAssistant(this.hass);
Expand Down
85 changes: 7 additions & 78 deletions src/panels/developer-tools/state/developer-tools-state.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import "@material/mwc-button";
import "@polymer/paper-checkbox/paper-checkbox";
import "@polymer/paper-input/paper-input";
import "@polymer/paper-menu-button";
import copy from "copy-to-clipboard";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";

Expand All @@ -13,7 +11,6 @@ import "../../../components/ha-code-editor";
import "../../../resources/ha-style";
import { EventsMixin } from "../../../mixins/events-mixin";
import LocalizeMixin from "../../../mixins/localize-mixin";
import { showToast } from "../../../util/toast";

const ERROR_SENTINEL = {};
/*
Expand Down Expand Up @@ -63,10 +60,6 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
height: 24px;
padding: 0;
}
.entities paper-menu-button {
height: 24px;
padding: 0;
}
.entities td:nth-child(3) {
white-space: pre-wrap;
word-break: break-word;
Expand All @@ -75,9 +68,6 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
.entities a {
color: var(--primary-color);
}
paper-icon-item {
cursor: pointer;
}
</style>

<div class="inputs">
Expand Down Expand Up @@ -160,56 +150,13 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
<template is="dom-repeat" items="[[_entities]]" as="entity">
<tr>
<td>
<paper-menu-button close-on-activate>
<paper-icon-button
icon="hass:dots-vertical"
slot="dropdown-trigger"
alt="menu"
></paper-icon-button>
<paper-listbox
slot="dropdown-content"
role="listbox"
selected="{{selectedItem}}"
>
<paper-icon-item on-click="entityMoreInfo">
<ha-icon
icon="hass:information-outline"
slot="item-icon"
></ha-icon>
[[localize('ui.panel.developer-tools.tabs.states.more_info')]]
</paper-icon-item>

<paper-icon-item action="copyId" on-click="entityCopyValue">
<ha-icon
icon="hass:content-copy"
slot="item-icon"
></ha-icon>
[[localize('ui.panel.developer-tools.tabs.states.copy_entity_id')]]
</paper-icon-item>

<paper-icon-item
action="copyState"
on-click="entityCopyValue"
>
<ha-icon
icon="hass:content-copy"
slot="item-icon"
></ha-icon>
[[localize('ui.panel.developer-tools.tabs.states.copy_entity_state')]]
</paper-icon-item>

<paper-icon-item
action="copyAttributes"
on-click="entityCopyValue"
>
<ha-icon
icon="hass:content-copy"
slot="item-icon"
></ha-icon>
[[localize('ui.panel.developer-tools.tabs.states.copy_entity_attribute')]]
</paper-icon-item>
</paper-listbox>
</paper-menu-button>
<paper-icon-button
on-click="entityMoreInfo"
icon="hass:information-outline"
alt="[[localize('ui.panel.developer-tools.tabs.states.more_info')]]"
title="[[localize('ui.panel.developer-tools.tabs.states.more_info')]]"
>
</paper-icon-button>
<a href="#" on-click="entitySelected">[[entity.entity_id]]</a>
</td>
<td>[[entity.state]]</td>
Expand Down Expand Up @@ -308,24 +255,6 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
this.fire("hass-more-info", { entityId: ev.model.entity.entity_id });
}

entityCopyValue(ev) {
var action = ev.currentTarget.attributes.action.value;
if (action === "copyId") {
copy(ev.model.entity.entity_id);
} else if (action === "copyState") {
copy(ev.model.entity.state);
} else if (action === "copyAttributes") {
copy(safeDump(ev.model.entity.attributes).replace(/\n/g, "<br />"));
} else {
return;
}
showToast(this, {
message: this.hass.localize(
"ui.panel.developer-tools.tabs.states.copied"
),
});
}

handleSetState() {
if (!this._entityId) {
alert(
Expand Down
6 changes: 1 addition & 5 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2050,11 +2050,7 @@
"filter_attributes": "Filter attributes",
"no_entities": "No entities",
"more_info": "More Info",
"alert_entity_field": "Entity is a mandatory field",
"copy_entity_id": "Copy ID",
"copy_entity_state": "Copy state",
"copy_entity_attribute": "Copy attributes",
"copied": "Copied to clipboard"
"alert_entity_field": "Entity is a mandatory field"
},
"templates": {
"title": "Template",
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5069,13 +5069,6 @@ copy-props@^2.0.1:
each-props "^1.3.0"
is-plain-object "^2.0.1"

copy-to-clipboard@^1.0.9:
version "1.1.1"
resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-1.1.1.tgz#5bcddb4e25743f1a9e862554363e23fc78077b78"
integrity sha1-W83bTiV0PxqehiVUNj4j/HgHe3g=
dependencies:
toggle-selection "^1.0.3"

copy-webpack-plugin@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.0.2.tgz#56186dfddbf9aa1b29c97fa4c796c1be98870da4"
Expand Down Expand Up @@ -13054,11 +13047,6 @@ to-through@^2.0.0:
dependencies:
through2 "^2.0.3"

toggle-selection@^1.0.3:
version "1.0.6"
resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32"
integrity sha1-bkWxJj8gF/oKzH2J14sVuL932jI=

toidentifier@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
Expand Down