Fix a bunch of lint errors (#1044)
* Fix a bunch of lint errors * Add behavior jsdoc * Convert ha-markdown to polymer element * Update lint commandpull/1053/head
parent
0e227708b9
commit
06502cb93a
|
@ -6,6 +6,8 @@ class HassioData extends Polymer.Element {
|
|||
|
||||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
|
||||
supervisor: {
|
||||
type: Object,
|
||||
notify: true,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"dev-es5": "npm run gulp ru_all_es5 gen-service-worker-es5",
|
||||
"dev-watch-es5": "npm run gulp watch_ru_all_es5 gen-service-worker-es5",
|
||||
"lint_js": "eslint src panels js hassio test-mocha --ext js,html",
|
||||
"lint_html": "ls -1 src/home-assistant.html panels/**/ha-panel-*.html | xargs polymer lint --input",
|
||||
"lint_html": "find src panels hassio -name '*.html' | grep -v hassio/index.html | xargs polymer lint --input",
|
||||
"mocha": "node_modules/.bin/mocha --opts test-mocha/mocha.opts",
|
||||
"test": "npm run lint_js && npm run lint_html && npm run mocha"
|
||||
},
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<link rel="import" href="../../../bower_components/paper-icon-button/paper-icon-button.html">
|
||||
|
||||
<link rel='import' href='../../../src/layouts/ha-app-layout.html'>
|
||||
<link rel='import' href='../../../src/components/ha-markdown.html'>
|
||||
<link rel='import' href='../../../src/util/hass-mixins.html'>
|
||||
|
||||
<link rel="import" href="../ha-config-section.html">
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
<link rel="import" href="../../../src/util/hass-mixins.html">
|
||||
<link rel="import" href='../../../src/resources/ha-style.html'>
|
||||
|
||||
<link rel="import" href="../ha-config-section.html">
|
||||
|
||||
<dom-module id="ha-config-cloud-account">
|
||||
<template>
|
||||
<style include="iron-flex ha-style">
|
||||
|
@ -116,6 +118,7 @@ class HaConfigCloudAccount extends window.hassMixins.EventsMixin(Polymer.Element
|
|||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
isWide: Boolean,
|
||||
account: {
|
||||
type: Object,
|
||||
observer: '_accountChanged',
|
||||
|
|
|
@ -4,12 +4,16 @@
|
|||
<link rel="import" href='../../../bower_components/paper-icon-button/paper-icon-button.html'>
|
||||
<link rel="import" href='../../../bower_components/paper-input/paper-input.html'>
|
||||
<link rel="import" href='../../../bower_components/paper-ripple/paper-ripple.html'>
|
||||
<link rel="import" href='../../../bower_components/paper-item/paper-item.html'>
|
||||
<link rel="import" href='../../../bower_components/paper-item/paper-item-body.html'>
|
||||
|
||||
<link rel="import" href="../../../src/layouts/hass-subpage.html">
|
||||
<link rel="import" href="../../../src/util/hass-mixins.html">
|
||||
<link rel="import" href='../../../src/resources/ha-style.html'>
|
||||
<link rel="import" href='../../../src/components/buttons/ha-progress-button.html'>
|
||||
|
||||
<link rel="import" href="../ha-config-section.html">
|
||||
|
||||
<dom-module id="ha-config-cloud-login">
|
||||
<template>
|
||||
<style include="iron-flex ha-style">
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
<link rel="import" href='../../../src/resources/ha-style.html'>
|
||||
<link rel="import" href='../../../src/components/buttons/ha-progress-button.html'>
|
||||
|
||||
<link rel="import" href="../ha-config-section.html">
|
||||
|
||||
<dom-module id="ha-config-cloud-register">
|
||||
<template>
|
||||
<style include="iron-flex ha-style">
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<ha-config-cloud-forgot-password
|
||||
page-name='forgot-password'
|
||||
hass='[[hass]]'
|
||||
is-wide='[[isWide]]'
|
||||
email='{{_loginEmail}}'
|
||||
></ha-config-cloud-forgot-password>
|
||||
</template>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
<link rel='import' href='../../../src/resources/ha-style.html'>
|
||||
<link rel='import' href='../../../src/layouts/hass-subpage.html'>
|
||||
|
||||
<link rel='import' href='../ha-config-section.html'>
|
||||
|
||||
<link rel='import' href='./ha-config-flow.html'>
|
||||
|
||||
<dom-module id="ha-config-entries">
|
||||
|
@ -106,6 +108,7 @@
|
|||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
isWide: Boolean,
|
||||
|
||||
_flowId: {
|
||||
type: String,
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
>
|
||||
<template is='dom-repeat'
|
||||
items='[[schema.options]]'>
|
||||
<paper-item item-name='[[item]]'>[[item]]</paper-item>
|
||||
<paper-item item-name$='[[item]]'>[[item]]</paper-item>
|
||||
</template>
|
||||
</paper-listbox>
|
||||
</paper-dropdown-menu>
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<link rel='import' href='../../../src/util/hass-mixins.html'>
|
||||
|
||||
<link rel="import" href="./ha-config-section-core.html">
|
||||
<!-- <link rel="import" href="./ha-config-section-group.html"> -->
|
||||
<link rel="import" href="./ha-config-section-hassbian.html">
|
||||
<link rel="import" href="./ha-config-section-push-notifications.html">
|
||||
<link rel="import" href="./ha-config-section-translation.html">
|
||||
|
@ -44,15 +43,6 @@
|
|||
</app-header>
|
||||
|
||||
<div class$='[[computeClasses(isWide)]]'>
|
||||
<!--
|
||||
Sortable.js doesn't work in Polymer 2 making this panel useless.
|
||||
Disabling for now.
|
||||
<ha-config-section-group
|
||||
is-wide='[[isWide]]'
|
||||
hass='[[hass]]'
|
||||
></ha-config-section-group>
|
||||
-->
|
||||
|
||||
<ha-config-section-core
|
||||
is-wide='[[isWide]]'
|
||||
hass='[[hass]]'
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
<link rel="import" href="../../../bower_components/polymer/polymer-element.html">
|
||||
<link rel="import" href="../../../bower_components/paper-button/paper-button.html">
|
||||
<link rel="import" href="../../../bower_components/paper-card/paper-card.html">
|
||||
<link rel="import" href="../../../bower_components/paper-checkbox/paper-checkbox.html">
|
||||
<link rel="import" href="../../../bower_components/paper-spinner/paper-spinner.html">
|
||||
<link rel="import" href="../../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
|
||||
<link rel='import' href='../../../bower_components/paper-listbox/paper-listbox.html'>
|
||||
<link rel='import' href='../../../bower_components/paper-item/paper-item.html'>
|
||||
|
||||
<link rel="import" href="../../../src/resources/ha-style.html">
|
||||
<link rel="import" href="../../../src/util/hass-util.html">
|
||||
|
||||
<link rel="import" href="../ha-config-section.html">
|
||||
<link rel="import" href="../ha-entity-config.html">
|
||||
<link rel="import" href="./ha-form-group.html">
|
||||
|
||||
<dom-module id="ha-config-section-group">
|
||||
<template>
|
||||
<ha-config-section is-wide='[[isWide]]'>
|
||||
<span slot='header'>Groups & Views</span>
|
||||
<span slot='introduction'>
|
||||
Use groups to organize your entities and make Home Assistant really your own.
|
||||
<br><br>
|
||||
Got more groups than you can handle? Create views to manage your groups.
|
||||
</span>
|
||||
|
||||
<ha-entity-config
|
||||
hass='[[hass]]'
|
||||
label='Group'
|
||||
entities='[[entities]]'
|
||||
config='[[entityConfig]]'>
|
||||
</ha-entity-config>
|
||||
</ha-config-section>
|
||||
</template>
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
class HaConfigSectionGroup extends Polymer.Element {
|
||||
static get is() { return 'ha-config-section-group'; }
|
||||
|
||||
static get properties() {
|
||||
return {
|
||||
hass: {
|
||||
type: Object,
|
||||
},
|
||||
|
||||
isWide: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
|
||||
entities: {
|
||||
type: Array,
|
||||
computed: 'computeEntities(hass)',
|
||||
},
|
||||
|
||||
entityConfig: {
|
||||
type: Object,
|
||||
value: {
|
||||
component: 'ha-form-group',
|
||||
computeSelectCaption: function (stateObj) {
|
||||
return window.hassUtil.computeStateName(stateObj) +
|
||||
(stateObj.attributes.view ? ' (view)' : '');
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
computeEntities(hass) {
|
||||
return Object.keys(hass.states)
|
||||
.map(function (key) { return hass.states[key]; })
|
||||
.filter(function (entity) {
|
||||
return (window.hassUtil.computeDomain(entity) === 'group' &&
|
||||
!entity.attributes.auto);
|
||||
})
|
||||
.sort(window.hassUtil.sortByName);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define(HaConfigSectionGroup.is, HaConfigSectionGroup);
|
||||
</script>
|
|
@ -20,7 +20,7 @@
|
|||
<paper-dropdown-menu label="[[localize('ui.panel.config.core.section.translation.language')]]" dynamic-align>
|
||||
<paper-listbox slot="dropdown-content" on-selected-item-changed="handleLanguageSelect" attr-for-selected="language-tag" selected="[[language]]">
|
||||
<template is='dom-repeat' items='[[languages]]'>
|
||||
<paper-item language-tag="[[item.tag]]">[[item.nativeName]]</paper-item>
|
||||
<paper-item language-tag$="[[item.tag]]">[[item.nativeName]]</paper-item>
|
||||
</template>
|
||||
</paper-listbox>
|
||||
></paper-dropdown-menu>
|
||||
|
|
|
@ -1,195 +0,0 @@
|
|||
<link rel="import" href="../../../bower_components/polymer/polymer-element.html">
|
||||
<link rel="import" href="../../../bower_components/iron-icon/iron-icon.html">
|
||||
<link rel="import" href="../../../bower_components/paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="../../../bower_components/paper-menu-button/paper-menu-button.html">
|
||||
<link rel="import" href="../../../bower_components/paper-radio-group/paper-radio-group.html">
|
||||
<link rel="import" href="../../../bower_components/paper-radio-button/paper-radio-button.html">
|
||||
<link rel="import" href="../../../bower_components/polymer-sortablejs/polymer-sortablejs.html">
|
||||
|
||||
<link rel="import" href="../../../src/components/entity/state-info.html">
|
||||
|
||||
<link rel="import" href="../ha-form-style.html">
|
||||
|
||||
<dom-module id="ha-form-group">
|
||||
<template>
|
||||
<style include="iron-flex ha-style ha-form-style">
|
||||
.entities-header {
|
||||
@apply --layout-horizontal;
|
||||
@apply --layout-justified;
|
||||
@apply --layout-center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.drag-handle {
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.sortable-chosen .drag-handle, .sortable-ghost {
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
sortable-js {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.entity-row {
|
||||
@apply --layout-horizontal;
|
||||
@apply --layout-center;
|
||||
padding: 4px 0;
|
||||
border-top: 1px solid rgba(0, 0, 0, .12);
|
||||
}
|
||||
|
||||
.entity-row:first-child {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.entity-row.sortable-chosen {
|
||||
background-color: var(--paper-grey-200);
|
||||
/* invisible border so we don't change height. */
|
||||
border-top: 1px solid rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.entity-row .unknown {
|
||||
padding-left: 56px;
|
||||
}
|
||||
|
||||
.entity-row paper-icon-button {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.entity-row:not(.sortable-chosen):hover paper-icon-button {
|
||||
visibility: visible;
|
||||
}
|
||||
</style>
|
||||
<div class='form-group'>
|
||||
<paper-input
|
||||
class='form-control flex'
|
||||
label='Name'
|
||||
value='{{entityName}}'>
|
||||
</paper-input>
|
||||
</div>
|
||||
|
||||
<div class='form-group'>
|
||||
<label>Type</label>
|
||||
<paper-radio-group
|
||||
selected='{{entityType}}'
|
||||
class='form-control'
|
||||
>
|
||||
<paper-radio-button name='group'>Group</paper-radio-button>
|
||||
<paper-radio-button name='view'>View</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</div>
|
||||
|
||||
<div class='form-group vertical entities'>
|
||||
<div class='entities-header'>
|
||||
<label>Entities (drag to reorder):</label>
|
||||
<!-- To be done
|
||||
<paper-menu-button
|
||||
dynamic-align
|
||||
class='form-control'
|
||||
>
|
||||
<paper-icon-button
|
||||
icon='mdi:plus'
|
||||
slot="dropdown-trigger"
|
||||
></paper-icon-button>
|
||||
<paper-listbox
|
||||
slot="dropdown-content"
|
||||
selected='{{entityPollingIntensity}}'
|
||||
>
|
||||
<paper-item>Do not poll (0)</paper-item>
|
||||
<paper-item>Poll every time (1)</paper-item>
|
||||
<paper-item>Poll every other time (2)</paper-item>
|
||||
</paper-listbox>
|
||||
</paper-menu-button>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<sortable-js
|
||||
class='form-control'
|
||||
on-choose='handleRowChosen'
|
||||
handle='.drag-handle'
|
||||
>
|
||||
<template is="dom-repeat" items='{{entityChildren}}'>
|
||||
<div class='entity-row'>
|
||||
<iron-icon icon='mdi:drag-vertical' class='drag-handle'></iron-icon>
|
||||
<template is='dom-if' if='[[!item.state]]'>
|
||||
<div class='unknown flex'>Unknown entity [[item.entity_id]]</div>
|
||||
</template>
|
||||
<template is='dom-if' if='[[item.state]]' restamp>
|
||||
<state-info state-obj='[[item]]' class='flex'></state-info>
|
||||
</template>
|
||||
<!-- <paper-icon-button icon='mdi:delete'></paper-icon-button> -->
|
||||
</div>
|
||||
</template>
|
||||
</sortable-js>
|
||||
</div>
|
||||
</template>
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
class HaFormGroup extends Polymer.Element {
|
||||
static get is() { return 'ha-form-group'; }
|
||||
|
||||
static get properties() {
|
||||
return {
|
||||
hass: {
|
||||
type: Object,
|
||||
},
|
||||
|
||||
entity: {
|
||||
type: Object,
|
||||
},
|
||||
|
||||
entityName: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
|
||||
entityType: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
entityChildren: {
|
||||
type: Object,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
handleRowChosen(ev) {
|
||||
// Polymer element and sortablejs both fire the same events, filter one out
|
||||
if (!ev.detail || !window.navigator.vibrate) return;
|
||||
|
||||
// Tell the user that moving his finger now will start dragging.
|
||||
window.navigator.vibrate(50);
|
||||
}
|
||||
|
||||
loadEntity(entity) {
|
||||
var states = this.hass.states;
|
||||
this.entity = entity;
|
||||
this.entityName = entity.attributes.friendly_name || '';
|
||||
this.entityType = entity.attributes.view ? 'view' : 'group';
|
||||
this.entityChildren = entity.attributes.entity_id
|
||||
.map(function (ent) {
|
||||
return states[ent] || { state: false, entity_id: ent, attributes: {} };
|
||||
});
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
saveEntity() {
|
||||
var data = {
|
||||
name: this.entityName,
|
||||
view: this.entityType === 'view',
|
||||
entities: this.entityChildren.map(function (ent) { return ent.entity_id; }),
|
||||
};
|
||||
|
||||
var objectId = this.entity.entity_id.split('.')[1];
|
||||
return this.hass.callApi('POST', 'config/group/config/' + objectId, data);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define(HaFormGroup.is, HaFormGroup);
|
||||
</script>
|
|
@ -1,4 +1,11 @@
|
|||
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
|
||||
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
||||
<link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html">
|
||||
<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
|
||||
<link rel="import" href="../../bower_components/paper-listbox/paper-listbox.html">
|
||||
<link rel="import" href="../../bower_components/paper-card/paper-card.html">
|
||||
<link rel="import" href="../../bower_components/paper-item/paper-item.html">
|
||||
|
||||
<dom-module id="ha-entity-config">
|
||||
<template>
|
||||
<style include="iron-flex ha-style">
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
<ha-config-entries
|
||||
page-name='integrations'
|
||||
hass='[[hass]]'
|
||||
is-wide='[[isWide]]'
|
||||
></ha-config-entries>
|
||||
</template>
|
||||
</template>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<link rel="import" href="../../../bower_components/polymer/polymer-element.html">
|
||||
<link rel="import" href="../../../bower_components/paper-card/paper-card.html">
|
||||
<link rel="import" href="../../../bower_components/paper-button/paper-button.html">
|
||||
<link rel="import" href="../../../bower_components/paper-checkbox/paper-checkbox.html">
|
||||
<link rel="import" href="../../../bower_components/paper-input/paper-input.html">
|
||||
|
||||
<link rel="import" href="../ha-config-section.html">
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<link rel="import" href="../../../bower_components/polymer/polymer-element.html">
|
||||
<link rel="import" href="../../../bower_components/paper-card/paper-card.html">
|
||||
<link rel="import" href="../../../bower_components/paper-button/paper-button.html">
|
||||
|
||||
<dom-module id='zwave-node-information'>
|
||||
<template>
|
||||
|
|
|
@ -53,7 +53,10 @@
|
|||
<script>
|
||||
{
|
||||
const UPDATE_INTERVAL = 10000; // ms
|
||||
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
* @appliesMixin window.hassMixins.EventsMixin
|
||||
*/
|
||||
class HaCameraCard extends
|
||||
window.hassMixins.LocalizeMixin(window.hassMixins.EventsMixin(Polymer.Element)) {
|
||||
static get is() { return 'ha-camera-card'; }
|
||||
|
|
|
@ -206,6 +206,10 @@
|
|||
</dom-module>
|
||||
|
||||
<script>
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
* @appliesMixin window.hassMixins.EventsMixin
|
||||
*/
|
||||
class HaMediaPlayerCard extends
|
||||
window.hassMixins.LocalizeMixin(window.hassMixins.EventsMixin(Polymer.Element)) {
|
||||
static get is() { return 'ha-media_player-card'; }
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
</dom-module>
|
||||
|
||||
<script>
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
*/
|
||||
class HaPersistentNotificationCard extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||
static get is() { return 'ha-persistent_notification-card'; }
|
||||
static get properties() {
|
||||
|
|
|
@ -95,7 +95,9 @@
|
|||
'N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE',
|
||||
'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'
|
||||
];
|
||||
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
*/
|
||||
class HaWeatherCard extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||
static get is() { return 'ha-weather-card'; }
|
||||
static get properties() {
|
||||
|
@ -105,6 +107,9 @@
|
|||
type: Object,
|
||||
observer: 'checkRequirements'
|
||||
},
|
||||
attr: Object,
|
||||
windBearing: Object,
|
||||
nowCond: Object,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -151,6 +151,21 @@
|
|||
value: false,
|
||||
readOnly: true,
|
||||
},
|
||||
metas: {
|
||||
type: Array,
|
||||
value: () => [],
|
||||
},
|
||||
tooltip: {
|
||||
type: Object,
|
||||
value: () => ({
|
||||
opacity: '0',
|
||||
left: '0',
|
||||
top: '0',
|
||||
xPadding: '0',
|
||||
yPadding: '0'
|
||||
})
|
||||
},
|
||||
unit: Object,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -161,13 +176,6 @@
|
|||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
this._isAttached = true;
|
||||
this.set('tooltip', {
|
||||
opacity: '0',
|
||||
left: '0',
|
||||
top: '0',
|
||||
xPadding: '0',
|
||||
yPadding: '0'
|
||||
});
|
||||
this.onPropsChange();
|
||||
this._resizeListener = () => {
|
||||
this._debouncer = Polymer.Debouncer.debounce(
|
||||
|
@ -275,11 +283,11 @@
|
|||
}
|
||||
positionX += this._chart.canvas.offsetLeft;
|
||||
// Display, position, and set styles for font
|
||||
this.set(['tooltip', 'opacity'], 1);
|
||||
this.set(['tooltip', 'left'], positionX + 'px');
|
||||
this.set(['tooltip', 'top'], positionY + 'px');
|
||||
this.set(['tooltip', 'yPadding'], tooltip.yPadding);
|
||||
this.set(['tooltip', 'xPadding'], tooltip.xPadding);
|
||||
this.tooltip = Object.assign({}, this.tooltip, {
|
||||
opacity: 1,
|
||||
left: `${positionX}px`,
|
||||
top: `${positionY}px`,
|
||||
});
|
||||
}
|
||||
|
||||
_legendClick(event) {
|
||||
|
@ -320,7 +328,7 @@
|
|||
if (updateNeeded) {
|
||||
chart.update();
|
||||
}
|
||||
this.set('unit', this.data.unit);
|
||||
this.unit = this.data.unit;
|
||||
}
|
||||
_formatTickValue(value, index, values) {
|
||||
if (values.length === 0) {
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<link rel="import" href="../../../bower_components/vaadin-combo-box/vaadin-combo-box-light.html">
|
||||
<link rel="import" href="../../../bower_components/paper-item/paper-icon-item.html">
|
||||
<link rel="import" href="../../../bower_components/paper-item/paper-item-body.html">
|
||||
<link rel="import" href="../../../bower_components/paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="../../../bower_components/paper-input/paper-input.html">
|
||||
|
||||
<link rel='import' href='../../../src/util/hass-mixins.html'>
|
||||
|
||||
|
|
|
@ -67,8 +67,7 @@
|
|||
<template is='dom-repeat' items='[[cards.columns]]' as='column'>
|
||||
<div class='column flex-1'>
|
||||
<template is='dom-repeat' items='[[column]]' as='card'>
|
||||
<ha-card-chooser card-data='[[card]]' hass='[[hass]]'
|
||||
></ha-card-chooser>
|
||||
<ha-card-chooser card-data='[[card]]'></ha-card-chooser>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
|
||||
<link rel="import" href="../../bower_components/vaadin-combo-box/vaadin-combo-box-light.html">
|
||||
<link rel="import" href="../../bower_components/paper-item/paper-item.html">
|
||||
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="../../bower_components/paper-input/paper-input.html">
|
||||
|
||||
<dom-module id="ha-combo-box">
|
||||
<template>
|
||||
|
|
|
@ -1,9 +1,23 @@
|
|||
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
|
||||
|
||||
<link rel='import' href='../util/hass-mixins.html'>
|
||||
|
||||
<script>
|
||||
class HaMarkdown extends window.hassMixins.EventsMixin(HTMLElement) {
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.EventsMixin
|
||||
*/
|
||||
class HaMarkdown extends window.hassMixins.EventsMixin(Polymer.Element) {
|
||||
static get is() { return 'ha-markdown'; }
|
||||
|
||||
static get properties() {
|
||||
return {
|
||||
content: {
|
||||
type: String,
|
||||
observer: '_render',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
// 0 = not loaded, 1 = success, 2 = error
|
||||
this._scriptLoaded = 0;
|
||||
|
@ -17,11 +31,6 @@ class HaMarkdown extends window.hassMixins.EventsMixin(HTMLElement) {
|
|||
);
|
||||
}
|
||||
|
||||
set content(value) {
|
||||
this._content = value;
|
||||
this._render();
|
||||
}
|
||||
|
||||
_render() {
|
||||
if (this._scriptLoaded === 0 || this._renderScheduled) return;
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ class StateHistoryChartLine extends Polymer.Element {
|
|||
static get is() { return 'state-history-chart-line'; }
|
||||
static get properties() {
|
||||
return {
|
||||
chartData: Object,
|
||||
data: Object,
|
||||
unit: String,
|
||||
identifier: String,
|
||||
|
|
|
@ -31,6 +31,7 @@ class StateHistoryChartTimeline extends Polymer.Element {
|
|||
hass: {
|
||||
type: Object,
|
||||
},
|
||||
chartData: Object,
|
||||
data: {
|
||||
type: Object,
|
||||
observer: 'dataChanged',
|
||||
|
|
|
@ -90,7 +90,7 @@ class HaMoreInfoDialog extends window.hassMixins.DialogMixin(Polymer.Element) {
|
|||
large: {
|
||||
type: Boolean,
|
||||
reflectToAttribute: true,
|
||||
observer: 'notifyResize',
|
||||
observer: '_largeChanged',
|
||||
},
|
||||
|
||||
_dialogElement: Object,
|
||||
|
@ -160,6 +160,10 @@ class HaMoreInfoDialog extends window.hassMixins.DialogMixin(Polymer.Element) {
|
|||
_equals(a, b) {
|
||||
return a === b;
|
||||
}
|
||||
|
||||
_largeChanged() {
|
||||
this.notifyResize();
|
||||
}
|
||||
}
|
||||
customElements.define(HaMoreInfoDialog.is, HaMoreInfoDialog);
|
||||
</script>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<link rel='import' href='../../../../bower_components/paper-slider/paper-slider.html'>
|
||||
|
||||
<link rel='import' href='../../../util/cover-model.html'>
|
||||
<link rel='import' href='../../../components/ha-cover-tilt-controls.html'>
|
||||
|
||||
<dom-module id='more-info-cover'>
|
||||
<template>
|
||||
|
|
|
@ -39,6 +39,7 @@ class MoreInfoLock extends Polymer.Element {
|
|||
type: String,
|
||||
value: '',
|
||||
},
|
||||
isLocked: Boolean,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<link rel="import" href="../../../bower_components/app-layout/app-toolbar/app-toolbar.html">
|
||||
<link rel="import" href="../../../bower_components/paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="../../../bower_components/paper-input/paper-input.html">
|
||||
<link rel="import" href="../../../bower_components/paper-button/paper-button.html">
|
||||
|
||||
<link rel='import' href='../../util/hass-mixins.html'>
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">
|
||||
|
||||
<link rel="import" href="../components/ha-menu-button.html">
|
||||
|
||||
<dom-module id='hass-loading-screen'>
|
||||
<template>
|
||||
<style include='iron-flex ha-style'>
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
</dom-module>
|
||||
|
||||
<script>
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
*/
|
||||
class StateCardDisplay extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||
static get is() { return 'state-card-display'; }
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout-classes.html">
|
||||
|
||||
<link rel="import" href="../components/entity/state-info.html">
|
||||
<link rel="import" href="../util/hass-mixins.html">
|
||||
|
||||
<dom-module id="state-card-media_player">
|
||||
<template>
|
||||
|
@ -46,6 +47,9 @@
|
|||
</dom-module>
|
||||
|
||||
<script>
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
*/
|
||||
class StateCardMediaPlayer extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||
static get is() { return 'state-card-media_player'; }
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ class StateCardScript extends Polymer.Element {
|
|||
|
||||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
stateObj: Object,
|
||||
inDialog: {
|
||||
type: Boolean,
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<state-badge state-obj='[[stateObj]]' in-dialog='[[inDialog]]'></state-badge>
|
||||
<state-badge state-obj='[[stateObj]]'></state-badge>
|
||||
<a href$='[[stateObj.state]]' target='_blank' class='name' id='link'>[[computeStateName(stateObj)]]</a>
|
||||
</template>
|
||||
</dom-module>
|
||||
|
|
Loading…
Reference in New Issue