diff --git a/src/panels/lovelace/components/hui-generic-entity-row.js b/src/panels/lovelace/components/hui-generic-entity-row.js
index 445ceaf311..a2060148b0 100644
--- a/src/panels/lovelace/components/hui-generic-entity-row.js
+++ b/src/panels/lovelace/components/hui-generic-entity-row.js
@@ -9,6 +9,24 @@ import computeStateName from '../../../common/entity/compute_state_name.js';
class HuiGenericEntityRow extends PolymerElement {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.stateBadgeTemplate}
+
+ ${this.infoTemplate}
+
+
+
+
+
+ Entity not available: [[config.entity]]
+
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
-
-
- [[_computeName(config.name, _stateObj)]]
-
-
-
- [[_stateObj.entity_id]]
-
-
-
-
-
-
-
-
-
-
-
-
- Entity not available: [[config.entity]]
-
-
+ `;
+ }
+
+ static get stateBadgeTemplate() {
+ return html`
+
+ `;
+ }
+
+ static get infoTemplate() {
+ return html`
+
+ [[_computeName(config.name, _stateObj)]]
+
+
+
+ [[_stateObj.entity_id]]
+
+
+
+
+
+
+
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-climate-entity-row.js b/src/panels/lovelace/entity-rows/hui-climate-entity-row.js
index 079c7d33bd..0af95b7974 100644
--- a/src/panels/lovelace/entity-rows/hui-climate-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-climate-entity-row.js
@@ -6,21 +6,33 @@ import '../components/hui-generic-entity-row.js';
class HuiClimateEntityRow extends PolymerElement {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.climateControlTemplate}
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
-
+ state-obj="[[_stateObj]]"
+ >
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-cover-entity-row.js b/src/panels/lovelace/entity-rows/hui-cover-entity-row.js
index 435f34a215..cc8a62edd3 100644
--- a/src/panels/lovelace/entity-rows/hui-cover-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-cover-entity-row.js
@@ -8,6 +8,18 @@ import CoverEntity from '../../../util/cover-model.js';
class HuiCoverEntityRow extends PolymerElement {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.coverControlTemplate}
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
-
-
-
-
-
-
+ `;
+ }
+
+ static get coverControlTemplate() {
+ return html`
+
+
+
+
+
+
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-group-entity-row.js b/src/panels/lovelace/entity-rows/hui-group-entity-row.js
index 6dc6386ebe..900c5a53f2 100644
--- a/src/panels/lovelace/entity-rows/hui-group-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-group-entity-row.js
@@ -18,21 +18,27 @@ class HuiGroupEntityRow extends LocalizeMixin(PolymerElement) {
hass="[[hass]]"
config="[[_config]]"
>
-
-
-
-
-
- [[_computeState(_stateObj)]]
-
-
+ ${this.groupControlTemplate}
`;
}
+ static get groupControlTemplate() {
+ return html`
+
+
+
+
+
+ [[_computeState(_stateObj)]]
+
+
+ `;
+ }
+
static get properties() {
return {
hass: Object,
diff --git a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js
index 0aef748f0f..17a0de2801 100644
--- a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js
@@ -9,6 +9,19 @@ import '../components/hui-generic-entity-row.js';
class HuiInputNumberEntityRow extends mixinBehaviors([IronResizableBehavior], PolymerElement) {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.inputNumberControlTemplate}
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
-
-
-
-
[[_value]] [[_stateObj.attributes.unit_of_measurement]]
-
-
-
-
+
+
-
+ ignore-bar-touch
+ >
+ [[_value]] [[_stateObj.attributes.unit_of_measurement]]
+
+
+
+
+
+
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.js b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.js
index ca98eb40d3..5e592523bf 100644
--- a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.js
@@ -16,21 +16,7 @@ import EventsMixin from '../../../mixins/events-mixin.js';
class HuiInputSelectEntityRow extends EventsMixin(PolymerElement) {
static get template() {
return html`
-
+ ${this.styleTemplate}
@@ -49,6 +35,26 @@ class HuiInputSelectEntityRow extends EventsMixin(PolymerElement) {
`;
}
+ static get styleTemplate() {
+ return html`
+
+ `;
+ }
+
static get properties() {
return {
hass: Object,
diff --git a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.js b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.js
index f7229fc28b..c3f7a6d718 100644
--- a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.js
@@ -11,21 +11,27 @@ class HuiInputTextEntityRow extends PolymerElement {
hass="[[hass]]"
config="[[_config]]"
>
-
+ ${this.inputTextControlTemplate}
`;
}
+ static get inputTextControlTemplate() {
+ return html`
+
+ `;
+ }
+
static get properties() {
return {
hass: Object,
diff --git a/src/panels/lovelace/entity-rows/hui-lock-entity-row.js b/src/panels/lovelace/entity-rows/hui-lock-entity-row.js
index 1d43603516..6c0a59335b 100644
--- a/src/panels/lovelace/entity-rows/hui-lock-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-lock-entity-row.js
@@ -11,6 +11,18 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
*/
class HuiLockEntityRow extends LocalizeMixin(PolymerElement) {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.lockControlTemplate}
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
- [[_computeButtonTitle(_stateObj.state)]]
-
-
+ `;
+ }
+
+ static get lockControlTemplate() {
+ return html`
+
+ [[_computeButtonTitle(_stateObj.state)]]
+
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-scene-entity-row.js b/src/panels/lovelace/entity-rows/hui-scene-entity-row.js
index c8ed756450..1b839ded73 100644
--- a/src/panels/lovelace/entity-rows/hui-scene-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-scene-entity-row.js
@@ -11,6 +11,18 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
*/
class HuiSceneEntityRow extends LocalizeMixin(PolymerElement) {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.sceneControlTemplate}
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
- [[localize('ui.card.scene.activate')]]
-
-
+ `;
+ }
+
+ static get sceneControlTemplate() {
+ return html`
+
+ [[localize('ui.card.scene.activate')]]
+
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-script-entity-row.js b/src/panels/lovelace/entity-rows/hui-script-entity-row.js
index c2314c55eb..498b2cd35f 100644
--- a/src/panels/lovelace/entity-rows/hui-script-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.js
@@ -12,6 +12,18 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
*/
class HuiScriptEntityRow extends LocalizeMixin(PolymerElement) {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.scriptControlTemplate}
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
-
-
-
- [[localize('ui.card.script.execute')]]
-
-
+ `;
+ }
+
+ static get scriptControlTemplate() {
+ return html`
+
+
+
+
+ [[localize('ui.card.script.execute')]]
+
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-text-entity-row.js b/src/panels/lovelace/entity-rows/hui-text-entity-row.js
index c748e0d166..6e6d9565c5 100644
--- a/src/panels/lovelace/entity-rows/hui-text-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-text-entity-row.js
@@ -12,20 +12,32 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
*/
class HuiTextEntityRow extends LocalizeMixin(PolymerElement) {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+ ${this.textControlTemplate}
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
- [[_computeState(_stateObj)]]
-
-
+ `;
+ }
+
+ static get textControlTemplate() {
+ return html`
+
+ [[_computeState(_stateObj)]]
+
`;
}
diff --git a/src/panels/lovelace/entity-rows/hui-timer-entity-row.js b/src/panels/lovelace/entity-rows/hui-timer-entity-row.js
index bd65c5ba86..9434077845 100644
--- a/src/panels/lovelace/entity-rows/hui-timer-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-timer-entity-row.js
@@ -13,13 +13,19 @@ class HuiTimerEntityRow extends PolymerElement {
hass="[[hass]]"
config="[[_config]]"
>
-
- [[_computeDisplay(_stateObj, _timeRemaining)]]
-
+ ${this.timerControlTemplate}
`;
}
+ static get timerControlTemplate() {
+ return html`
+
+ [[_computeDisplay(_stateObj, _timeRemaining)]]
+
+ `;
+ }
+
static get properties() {
return {
hass: Object,
diff --git a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.js b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.js
index dc103cfacb..fa9f09795d 100644
--- a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.js
+++ b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.js
@@ -18,21 +18,27 @@ class HuiToggleEntityRow extends LocalizeMixin(PolymerElement) {
hass="[[hass]]"
config="[[_config]]"
>
-
-
-
-
-
- [[_computeState(_stateObj)]]
-
-
+ ${this.toggleControlTemplate}
`;
}
+ static get toggleControlTemplate() {
+ return html`
+
+
+
+
+
+ [[_computeState(_stateObj)]]
+
+
+ `;
+ }
+
static get properties() {
return {
hass: Object,
diff --git a/src/panels/lovelace/special-rows/hui-call-service-row.js b/src/panels/lovelace/special-rows/hui-call-service-row.js
index 442da03ab3..1e52a50777 100644
--- a/src/panels/lovelace/special-rows/hui-call-service-row.js
+++ b/src/panels/lovelace/special-rows/hui-call-service-row.js
@@ -7,6 +7,19 @@ import callService from '../common/call-service.js';
class HuiCallServiceRow extends PolymerElement {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+
+
+ [[_config.name]]
+
+
[[_config.action_name]]
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
-
- [[_config.name]]
-
-
[[_config.action_name]]
-
`;
}
diff --git a/src/panels/lovelace/special-rows/hui-weblink-row.js b/src/panels/lovelace/special-rows/hui-weblink-row.js
index bbcec02489..443b2dfa25 100644
--- a/src/panels/lovelace/special-rows/hui-weblink-row.js
+++ b/src/panels/lovelace/special-rows/hui-weblink-row.js
@@ -5,6 +5,18 @@ import '../../../components/ha-icon.js';
class HuiWeblinkRow extends PolymerElement {
static get template() {
+ return html`
+ ${this.styleTemplate}
+
+
+
+ [[_config.name]]
+
+
+ `;
+ }
+
+ static get styleTemplate() {
return html`
-
-
-
- [[_config.name]]
-
-
`;
}