diff --git a/.eslintrc b/.eslintrc index 6f8231d069..e53662fda9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,6 +11,7 @@ "func-names": 0, "prefer-arrow-callback": 0, "no-underscore-dangle": 0, - "no-var": 0 + "no-var": 0, + "strict": 0 } } diff --git a/src/components/ha-labeled-slider.html b/src/components/ha-labeled-slider.html new file mode 100644 index 0000000000..d9f6c44453 --- /dev/null +++ b/src/components/ha-labeled-slider.html @@ -0,0 +1,60 @@ + + + + + + + + + + diff --git a/src/dialogs/more-info-dialog.js b/src/dialogs/more-info-dialog.js index a78df9882a..5800141fb8 100644 --- a/src/dialogs/more-info-dialog.js +++ b/src/dialogs/more-info-dialog.js @@ -66,6 +66,10 @@ export default new Polymer({ }, }, + ready() { + this.$.scrollable.dialogElement = this.$.dialog; + }, + /** * We depend on a delayed dialogOpen value to tell the chart component * that the data is there. Otherwise the chart component will render diff --git a/src/more-infos/more-info-alarm_control_panel.js b/src/more-infos/more-info-alarm_control_panel.js index 47954f758a..2014bbbda4 100644 --- a/src/more-infos/more-info-alarm_control_panel.js +++ b/src/more-infos/more-info-alarm_control_panel.js @@ -2,15 +2,7 @@ import Polymer from '../polymer'; export default new Polymer({ is: 'more-info-alarm_control_panel', - handleDisarmTap() { - this.callService('alarm_disarm', { code: this.enteredCode }); - }, - handleHomeTap() { - this.callService('alarm_arm_home', { code: this.enteredCode }); - }, - handleAwayTap() { - this.callService('alarm_arm_away', { code: this.enteredCode }); - }, + properties: { hass: { type: Object, @@ -53,6 +45,7 @@ export default new Polymer({ computed: 'validateCode(enteredCode, codeFormat)', }, }, + validateCode(code, format) { const re = new RegExp(format); if (format === null) { @@ -60,26 +53,40 @@ export default new Polymer({ } return re.test(code); }, + stateObjChanged(newVal) { if (newVal) { this.codeFormat = newVal.attributes.code_format; this.codeInputVisible = this.codeFormat !== null; this.codeInputEnabled = ( newVal.state === 'armed_home' || - newVal.state === 'armed_away' || - newVal.state === 'disarmed' || - newVal.state === 'pending' || - newVal.state === 'triggered'); + newVal.state === 'armed_away' || + newVal.state === 'disarmed' || + newVal.state === 'pending' || + newVal.state === 'triggered'); this.disarmButtonVisible = ( - newVal.state === 'armed_home' || - newVal.state === 'armed_away' || - newVal.state === 'pending' || - newVal.state === 'triggered'); + newVal.state === 'armed_home' || + newVal.state === 'armed_away' || + newVal.state === 'pending' || + newVal.state === 'triggered'); this.armHomeButtonVisible = newVal.state === 'disarmed'; this.armAwayButtonVisible = newVal.state === 'disarmed'; } this.async(() => this.fire('iron-resize'), 500); }, + + handleDisarmTap() { + this.callService('alarm_disarm', { code: this.enteredCode }); + }, + + handleHomeTap() { + this.callService('alarm_arm_home', { code: this.enteredCode }); + }, + + handleAwayTap() { + this.callService('alarm_arm_away', { code: this.enteredCode }); + }, + callService(service, data) { const serviceData = data || {}; serviceData.entity_id = this.stateObj.entityId; diff --git a/src/more-infos/more-info-content.js b/src/more-infos/more-info-content.js index d0902e4afc..0166b61e11 100644 --- a/src/more-infos/more-info-content.js +++ b/src/more-infos/more-info-content.js @@ -3,7 +3,6 @@ import Polymer from '../polymer'; import dynamicContentUpdater from '../util/dynamic-content-updater'; import stateMoreInfoType from '../util/state-more-info-type'; -import './more-info-default'; import './more-info-group'; import './more-info-sun'; import './more-info-configurator'; diff --git a/src/more-infos/more-info-default.html b/src/more-infos/more-info-default.html index 1d61895276..69c84ed15a 100644 --- a/src/more-infos/more-info-default.html +++ b/src/more-infos/more-info-default.html @@ -11,10 +11,46 @@
+ + diff --git a/src/more-infos/more-info-default.js b/src/more-infos/more-info-default.js deleted file mode 100644 index 7ff8eba87d..0000000000 --- a/src/more-infos/more-info-default.js +++ /dev/null @@ -1,27 +0,0 @@ -import Polymer from '../polymer'; - -const FILTER_KEYS = ['entity_picture', 'friendly_name', 'icon', 'unit_of_measurement']; - -export default new Polymer({ - is: 'more-info-default', - - properties: { - stateObj: { - type: Object, - }, - }, - - computeDisplayAttributes(stateObj) { - if (!stateObj) { - return []; - } - - return Object.keys(stateObj.attributes).filter((key) => FILTER_KEYS.indexOf(key) === -1); - }, - - getAttributeValue(stateObj, attribute) { - const value = stateObj.attributes[attribute]; - - return Array.isArray(value) ? value.join(', ') : value; - }, -}); diff --git a/src/more-infos/more-info-hvac.html b/src/more-infos/more-info-hvac.html index f7eb7ed8d5..98e096f84e 100644 --- a/src/more-infos/more-info-hvac.html +++ b/src/more-infos/more-info-hvac.html @@ -47,8 +47,8 @@
-
-
Target Temperature
+
+
Target Temperature
-
-
Target Humidity
+
+
Target Humidity
+ @@ -14,7 +15,6 @@ ha-color-picker { display: block; - margin: 0 auto; width: 250px; max-height: 0px; @@ -24,8 +24,7 @@ .has-brightness .brightness, .has-color_temp .color_temp { - margin-bottom: 8px; - max-height: 40px; + max-height: 84px; } .has-rgb_color ha-color-picker { @@ -34,19 +33,20 @@