diff --git a/panels/config/automation/ha-automation-editor.html b/panels/config/automation/ha-automation-editor.html
index d51e87c2c3..9397b691ee 100644
--- a/panels/config/automation/ha-automation-editor.html
+++ b/panels/config/automation/ha-automation-editor.html
@@ -1,4 +1,4 @@
-
+
@@ -16,6 +16,8 @@
+
+
@@ -108,80 +110,84 @@
diff --git a/panels/config/automation/ha-automation-picker.html b/panels/config/automation/ha-automation-picker.html
index af6969ce09..6d62419e01 100644
--- a/panels/config/automation/ha-automation-picker.html
+++ b/panels/config/automation/ha-automation-picker.html
@@ -1,4 +1,4 @@
-
+
@@ -8,6 +8,8 @@
+
+
@@ -92,54 +94,58 @@
diff --git a/panels/config/automation/ha-config-automation.html b/panels/config/automation/ha-config-automation.html
index e6ba7cc5e4..f4769e9eb2 100644
--- a/panels/config/automation/ha-config-automation.html
+++ b/panels/config/automation/ha-config-automation.html
@@ -1,4 +1,4 @@
-
+
@@ -45,37 +45,39 @@
diff --git a/panels/config/core/ha-config-section-hassbian.html b/panels/config/core/ha-config-section-hassbian.html
index aba811adde..70ec75e922 100644
--- a/panels/config/core/ha-config-section-hassbian.html
+++ b/panels/config/core/ha-config-section-hassbian.html
@@ -101,12 +101,13 @@ class HaConfigSectionHassbian extends Polymer.Element {
}
if (isInstalling) {
- this.async(this.updateStatus, 5000);
+ setTimeout(() => this.updateStatus(), 5000);
}
}.bind(this));
}
- attached() {
+ connectedCallback() {
+ super.connectedCallback();
this.updateStatus = this.updateStatus.bind(this);
this.updateStatus();
}
diff --git a/panels/config/dashboard/ha-config-navigation.html b/panels/config/dashboard/ha-config-navigation.html
index 631aadcb70..6b4f38adb0 100644
--- a/panels/config/dashboard/ha-config-navigation.html
+++ b/panels/config/dashboard/ha-config-navigation.html
@@ -1,9 +1,11 @@
-
+
+
+
@@ -36,45 +38,44 @@
diff --git a/panels/map/ha-panel-map.html b/panels/map/ha-panel-map.html
index 07baa535fe..e65e3b39b6 100644
--- a/panels/map/ha-panel-map.html
+++ b/panels/map/ha-panel-map.html
@@ -1,4 +1,4 @@
-
+
@@ -29,26 +29,29 @@
diff --git a/panels/shopping-list/ha-panel-shopping-list.html b/panels/shopping-list/ha-panel-shopping-list.html
index 611c37754a..d2c74b4aec 100644
--- a/panels/shopping-list/ha-panel-shopping-list.html
+++ b/panels/shopping-list/ha-panel-shopping-list.html
@@ -1,4 +1,4 @@
-
+
@@ -138,55 +138,60 @@
diff --git a/src/cards/ha-weather-card.html b/src/cards/ha-weather-card.html
index 2d3241fc1d..b494e1e1a7 100644
--- a/src/cards/ha-weather-card.html
+++ b/src/cards/ha-weather-card.html
@@ -70,9 +70,7 @@
diff --git a/src/components/buttons/ha-call-api-button.html b/src/components/buttons/ha-call-api-button.html
index 1db75f824e..dd30a6949f 100644
--- a/src/components/buttons/ha-call-api-button.html
+++ b/src/components/buttons/ha-call-api-button.html
@@ -1,4 +1,4 @@
-
+
@@ -13,40 +13,42 @@
diff --git a/src/components/buttons/ha-call-service-button.html b/src/components/buttons/ha-call-service-button.html
index 3df2f30ba4..02a99ee0ed 100644
--- a/src/components/buttons/ha-call-service-button.html
+++ b/src/components/buttons/ha-call-service-button.html
@@ -1,4 +1,4 @@
-
+
@@ -12,34 +12,36 @@
diff --git a/src/components/buttons/ha-progress-button.html b/src/components/buttons/ha-progress-button.html
index 8719df1f00..6e6a081e03 100644
--- a/src/components/buttons/ha-progress-button.html
+++ b/src/components/buttons/ha-progress-button.html
@@ -1,4 +1,4 @@
-
+
@@ -58,51 +58,56 @@
diff --git a/src/components/domain-icon.html b/src/components/domain-icon.html
index 03b6e2f29f..d75412d23e 100644
--- a/src/components/domain-icon.html
+++ b/src/components/domain-icon.html
@@ -1,4 +1,4 @@
-
+
@@ -9,23 +9,27 @@
diff --git a/src/components/entity/ha-entity-toggle.html b/src/components/entity/ha-entity-toggle.html
index 5677716e35..4354295e66 100644
--- a/src/components/entity/ha-entity-toggle.html
+++ b/src/components/entity/ha-entity-toggle.html
@@ -1,4 +1,4 @@
-
+
@@ -36,43 +36,43 @@
diff --git a/src/components/entity/ha-state-icon.html b/src/components/entity/ha-state-icon.html
index 0f23813b5d..beaf990185 100644
--- a/src/components/entity/ha-state-icon.html
+++ b/src/components/entity/ha-state-icon.html
@@ -1,4 +1,4 @@
-
+
@@ -9,17 +9,21 @@
diff --git a/src/components/entity/ha-state-label-badge.html b/src/components/entity/ha-state-label-badge.html
index fda3a29b93..02e1735237 100644
--- a/src/components/entity/ha-state-label-badge.html
+++ b/src/components/entity/ha-state-label-badge.html
@@ -1,4 +1,6 @@
-
+
+
+
@@ -45,30 +47,33 @@
diff --git a/src/components/entity/state-info.html b/src/components/entity/state-info.html
index 634ed47e76..2fb33399d4 100644
--- a/src/components/entity/state-info.html
+++ b/src/components/entity/state-info.html
@@ -1,4 +1,4 @@
-
+
@@ -57,26 +57,30 @@
diff --git a/src/components/ha-attributes.html b/src/components/ha-attributes.html
index d910834e2f..8cf7d6c061 100644
--- a/src/components/ha-attributes.html
+++ b/src/components/ha-attributes.html
@@ -1,4 +1,4 @@
-
+
@@ -30,12 +30,11 @@
diff --git a/src/components/ha-card.html b/src/components/ha-card.html
index dabbd598f2..747389f8e4 100644
--- a/src/components/ha-card.html
+++ b/src/components/ha-card.html
@@ -1,4 +1,4 @@
-
+
@@ -28,21 +28,25 @@
diff --git a/src/components/ha-cards.html b/src/components/ha-cards.html
index a718285340..8a903f0b21 100644
--- a/src/components/ha-cards.html
+++ b/src/components/ha-cards.html
@@ -1,4 +1,5 @@
+
diff --git a/src/components/ha-climate-control.html b/src/components/ha-climate-control.html
index 38b715ed84..d2bd669d62 100644
--- a/src/components/ha-climate-control.html
+++ b/src/components/ha-climate-control.html
@@ -1,4 +1,4 @@
-
+
@@ -40,66 +40,70 @@
-
-
+
diff --git a/src/components/ha-color-picker.html b/src/components/ha-color-picker.html
index dc41f34b45..e8ebdccd95 100644
--- a/src/components/ha-color-picker.html
+++ b/src/components/ha-color-picker.html
@@ -1,4 +1,6 @@
-
+
+
+
@@ -20,67 +22,75 @@
*
* Adapted to work with Polymer.
*/
-Polymer({
- is: 'ha-color-picker',
+class HaColorPicker extends window.hassMixins.EventsMixin(Polymer.Element) {
+ static get is() { return 'ha-color-picker'; }
- properties: {
- color: {
- type: Object,
- },
+ static get properties() {
+ return {
+ color: {
+ type: Object,
+ },
- width: {
- type: Number,
- },
+ width: {
+ type: Number,
+ },
- height: {
- type: Number,
- },
- },
+ height: {
+ type: Number,
+ },
+ };
+ }
- listeners: {
- mousedown: 'onMouseDown',
- mouseup: 'onMouseUp',
- touchstart: 'onTouchStart',
- touchend: 'onTouchEnd',
- },
+ ready() {
+ super.ready();
+ this.addEventListener('mousedown', ev => this.onMouseDown(ev));
+ this.addEventListener('mouseup', ev => this.onMouseUp(ev));
+ this.addEventListener('touchstart', ev => this.onTouchStart(ev));
+ this.addEventListener('touchend', ev => this.onTouchEnd(ev));
+ this.setColor = this.setColor.bind(this);
+ this.mouseMoveIsThrottled = true;
+ this.canvas = this.$.canvas;
+ this.context = this.canvas.getContext('2d');
+ this.drawGradient();
+ }
- onMouseDown: function (ev) {
+ onMouseDown(ev) {
this.onMouseMove(ev);
this.addEventListener('mousemove', this.onMouseMove);
- },
+ }
- onMouseUp: function () {
+ onMouseUp() {
this.removeEventListener('mousemove', this.onMouseMove);
- },
+ }
- onTouchStart: function (ev) {
+ onTouchStart(ev) {
this.onTouchMove(ev);
this.addEventListener('touchmove', this.onTouchMove);
- },
+ }
- onTouchEnd: function () {
+ onTouchEnd() {
this.removeEventListener('touchmove', this.onTouchMove);
- },
+ }
- onTouchMove: function (ev) {
+ onTouchMove(ev) {
if (!this.mouseMoveIsThrottled) {
return;
}
this.mouseMoveIsThrottled = false;
this.processColorSelect(ev.touches[0]);
- this.async(function () { this.mouseMoveIsThrottled = true; }.bind(this), 100);
- },
+ setTimeout(() => { this.mouseMoveIsThrottled = true; }, 100);
+ }
- onMouseMove: function (ev) {
+ onMouseMove(ev) {
if (!this.mouseMoveIsThrottled) {
return;
}
this.mouseMoveIsThrottled = false;
this.processColorSelect(ev);
this.async(function () { this.mouseMoveIsThrottled = true; }.bind(this), 100);
- },
+ }
- processColorSelect: function (ev) {
+ processColorSelect(ev) {
var rect = this.canvas.getBoundingClientRect();
// boundary check because people can move off-canvas.
@@ -90,29 +100,21 @@ Polymer({
}
this.onColorSelect(ev.clientX - rect.left, ev.clientY - rect.top);
- },
+ }
- onColorSelect: function (x, y) {
+ onColorSelect(x, y) {
var data = this.context.getImageData(x, y, 1, 1).data;
this.setColor({ r: data[0], g: data[1], b: data[2] });
- },
+ }
- setColor: function (rgb) {
+ setColor(rgb) {
this.color = rgb;
this.fire('colorselected', { rgb: this.color });
- },
+ }
- ready: function () {
- this.setColor = this.setColor.bind(this);
- this.mouseMoveIsThrottled = true;
- this.canvas = this.$.canvas;
- this.context = this.canvas.getContext('2d');
- this.drawGradient();
- },
-
- drawGradient: function () {
+ drawGradient() {
var style;
var width;
var height;
@@ -143,6 +145,8 @@ Polymer({
this.context.fillStyle = bwGradient;
this.context.fillRect(0, 0, width, height);
- },
-});
+ }
+}
+
+customElements.define(HaColorPicker.is, HaColorPicker);
diff --git a/src/components/ha-cover-controls.html b/src/components/ha-cover-controls.html
index 79ee35b068..86b09ce9e3 100644
--- a/src/components/ha-cover-controls.html
+++ b/src/components/ha-cover-controls.html
@@ -1,4 +1,4 @@
-
+
@@ -28,42 +28,47 @@
diff --git a/src/components/ha-cover-tilt-controls.html b/src/components/ha-cover-tilt-controls.html
index c54673ff10..a251fa7208 100644
--- a/src/components/ha-cover-tilt-controls.html
+++ b/src/components/ha-cover-tilt-controls.html
@@ -1,4 +1,4 @@
-
+
@@ -32,42 +32,47 @@
diff --git a/src/components/ha-demo-badge.html b/src/components/ha-demo-badge.html
index 1127e65c04..cf91b895b1 100644
--- a/src/components/ha-demo-badge.html
+++ b/src/components/ha-demo-badge.html
@@ -1,4 +1,4 @@
-
+
@@ -19,7 +19,9 @@
diff --git a/src/components/ha-icon-check.html b/src/components/ha-icon-check.html
index 3a4a53ab8a..8e17b27d85 100644
--- a/src/components/ha-icon-check.html
+++ b/src/components/ha-icon-check.html
@@ -1,4 +1,4 @@
-
+
@@ -37,10 +37,15 @@
diff --git a/src/components/ha-labeled-slider.html b/src/components/ha-labeled-slider.html
index c3befd3c64..d7cdd8ef1b 100644
--- a/src/components/ha-labeled-slider.html
+++ b/src/components/ha-labeled-slider.html
@@ -1,4 +1,4 @@
-
+
@@ -40,30 +40,34 @@
diff --git a/src/components/ha-menu-button.html b/src/components/ha-menu-button.html
index 51a66fb6cc..b5ced36730 100644
--- a/src/components/ha-menu-button.html
+++ b/src/components/ha-menu-button.html
@@ -1,6 +1,8 @@
-
+
+
+
diff --git a/src/more-infos/more-info-automation.html b/src/more-infos/more-info-automation.html
index c43c1e8d9a..21c08d7101 100644
--- a/src/more-infos/more-info-automation.html
+++ b/src/more-infos/more-info-automation.html
@@ -1,4 +1,4 @@
-
+
@@ -28,23 +28,27 @@
diff --git a/src/more-infos/more-info-camera.html b/src/more-infos/more-info-camera.html
index c8c9adde6c..9dd77403a5 100644
--- a/src/more-infos/more-info-camera.html
+++ b/src/more-infos/more-info-camera.html
@@ -1,4 +1,6 @@
-
+
+
+
@@ -18,33 +20,35 @@
diff --git a/src/more-infos/more-info-climate.html b/src/more-infos/more-info-climate.html
index 1b08945896..5ac7658c5b 100644
--- a/src/more-infos/more-info-climate.html
+++ b/src/more-infos/more-info-climate.html
@@ -1,4 +1,4 @@
-
+
@@ -8,6 +8,8 @@
+
+
@@ -179,47 +181,49 @@
diff --git a/src/more-infos/more-info-configurator.html b/src/more-infos/more-info-configurator.html
index e7148aab70..5a00339ef2 100644
--- a/src/more-infos/more-info-configurator.html
+++ b/src/more-infos/more-info-configurator.html
@@ -1,4 +1,4 @@
-
+
@@ -94,45 +94,47 @@
diff --git a/src/more-infos/more-info-content.html b/src/more-infos/more-info-content.html
index 1a95bc542f..fbde6cc5e2 100644
--- a/src/more-infos/more-info-content.html
+++ b/src/more-infos/more-info-content.html
@@ -1,4 +1,4 @@
-
+
@@ -20,25 +20,28 @@
diff --git a/src/more-infos/more-info-cover.html b/src/more-infos/more-info-cover.html
index 5f8ac86777..0539f7b25e 100644
--- a/src/more-infos/more-info-cover.html
+++ b/src/more-infos/more-info-cover.html
@@ -1,4 +1,4 @@
-
+
@@ -56,62 +56,66 @@
diff --git a/src/more-infos/more-info-default.html b/src/more-infos/more-info-default.html
index 65eaee7285..25abfd5cc2 100644
--- a/src/more-infos/more-info-default.html
+++ b/src/more-infos/more-info-default.html
@@ -1,4 +1,4 @@
-
+
@@ -9,13 +9,17 @@
diff --git a/src/more-infos/more-info-fan.html b/src/more-infos/more-info-fan.html
index acad2727a8..1d4d0d0345 100644
--- a/src/more-infos/more-info-fan.html
+++ b/src/more-infos/more-info-fan.html
@@ -1,4 +1,4 @@
-
+
@@ -7,6 +7,8 @@
+
+
@@ -71,31 +73,33 @@
diff --git a/src/more-infos/more-info-group.html b/src/more-infos/more-info-group.html
index 6b550992b9..a06a446a12 100644
--- a/src/more-infos/more-info-group.html
+++ b/src/more-infos/more-info-group.html
@@ -1,4 +1,4 @@
-
+
@@ -24,29 +24,33 @@
diff --git a/src/more-infos/more-info-light.html b/src/more-infos/more-info-light.html
index 60a9ea2e0e..d7a6b722eb 100644
--- a/src/more-infos/more-info-light.html
+++ b/src/more-infos/more-info-light.html
@@ -1,10 +1,12 @@
-
+
+
+
@@ -96,166 +98,171 @@
diff --git a/src/more-infos/more-info-lock.html b/src/more-infos/more-info-lock.html
index bfe86f05e4..70b044d967 100644
--- a/src/more-infos/more-info-lock.html
+++ b/src/more-infos/more-info-lock.html
@@ -1,4 +1,4 @@
-
+
@@ -22,41 +22,46 @@
diff --git a/src/more-infos/more-info-media_player.html b/src/more-infos/more-info-media_player.html
index 99ee82026b..21ddc5462b 100644
--- a/src/more-infos/more-info-media_player.html
+++ b/src/more-infos/more-info-media_player.html
@@ -1,4 +1,4 @@
-
+
@@ -10,6 +10,8 @@
+
+
@@ -120,305 +122,311 @@
diff --git a/src/more-infos/more-info-script.html b/src/more-infos/more-info-script.html
index 435e22bb9a..c6fe688c8a 100644
--- a/src/more-infos/more-info-script.html
+++ b/src/more-infos/more-info-script.html
@@ -1,4 +1,4 @@
-
+
@@ -16,13 +16,17 @@
diff --git a/src/more-infos/more-info-sun.html b/src/more-infos/more-info-sun.html
index d0dfec7135..4a17e8604c 100644
--- a/src/more-infos/more-info-sun.html
+++ b/src/more-infos/more-info-sun.html
@@ -1,4 +1,4 @@
-
+
@@ -25,47 +25,51 @@
diff --git a/src/more-infos/more-info-updater.html b/src/more-infos/more-info-updater.html
index 031ed3c2b8..a60130fa75 100644
--- a/src/more-infos/more-info-updater.html
+++ b/src/more-infos/more-info-updater.html
@@ -1,4 +1,4 @@
-
+
@@ -15,18 +15,22 @@
diff --git a/src/more-infos/more-info-vacuum.html b/src/more-infos/more-info-vacuum.html
index 0460d6dac9..6cba3877ec 100644
--- a/src/more-infos/more-info-vacuum.html
+++ b/src/more-infos/more-info-vacuum.html
@@ -1,4 +1,4 @@
-
+
@@ -86,75 +86,77 @@
diff --git a/src/util/ha-url-sync.html b/src/util/ha-url-sync.html
index 156ca90677..0f07b33279 100644
--- a/src/util/ha-url-sync.html
+++ b/src/util/ha-url-sync.html
@@ -1,11 +1,13 @@
+
+