UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 16 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[2994],{9146:function(t,e,n){"use strict";n.d(e,{d:function(){return o}});var r=n(40095),o=function(t,e){return t&&t.attributes.supported_features?Object.keys(e).map((function(n){return(0,r.e)(t,Number(n))?e[n]:""})).filter((function(t){return""!==t})).join(" "):""}},81303:function(t,e,n){"use strict";n(8878);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l(t);if(e){var o=l(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}function s(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(f,t);var e,n,r,s=c(f);function f(){return o(this,f),s.apply(this,arguments)}return e=f,(n=[{key:"ready",value:function(){var t=this;i(l(f.prototype),"ready",this).call(this),setTimeout((function(){"rtl"===window.getComputedStyle(t).direction&&(t.style.textAlign="right")}),100)}}])&&a(e.prototype,n),r&&a(e,r),f}(customElements.get("paper-dropdown-menu"));customElements.define("ha-paper-dropdown-menu",f)},52994:function(t,e,n){"use strict";n.r(e);n(21157),n(53973),n(51095);var r=n(21683),o=n(78956),a=n(50856),i=n(28426),u=n(9146),c=n(40095),s=(n(81303),n(43709),n(10983),n(11052));function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n <style include="iron-flex iron-flex-alignment"></style>\n <style>\n /* local DOM styles go here */\n :host {\n @apply --layout-flex;\n @apply --layout-horizontal;\n @apply --layout-justified;\n }\n .in-flux#target_temperature {\n color: var(--error-color);\n }\n #target_temperature {\n @apply --layout-self-center;\n font-size: 200%;\n }\n .control-buttons {\n font-size: 200%;\n text-align: right;\n }\n ha-icon-button {\n height: 48px;\n width: 48px;\n }\n </style>\n\n \x3c!-- local DOM goes here --\x3e\n <div id="target_temperature">[[value]] [[units]]</div>\n <div class="control-buttons">\n <div>\n <ha-icon-button\n icon="hass:chevron-up"\n on-click="incrementValue"\n ></ha-icon-button>\n </div>\n <div>\n <ha-icon-button\n icon="hass:chevron-down"\n on-click="decrementValue"\n ></ha-icon-button>\n </div>\n </div>\n ']);return f=function(){return t},t}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b(t);if(e){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}function d(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(i,t);var e,n,r,o=m(i);function i(){return p(this,i),o.apply(this,arguments)}return e=i,r=[{key:"template",get:function(){return(0,a.d)(f())}},{key:"properties",get:function(){return{value:{type:Number,observer:"valueChanged"},units:{type:String},min:{type:Number},max:{type:Number},step:{type:Number,value:1}}}}],(n=[{key:"temperatureStateInFlux",value:function(t){this.$.target_temperature.classList.toggle("in-flux",t)}},{key:"incrementValue",value:function(){var t=this.value+this.step;this.value<this.max&&(this.last_changed=Date.now(),this.temperatureStateInFlux(!0)),t<=this.max?t<=this.min?this.value=this.min:this.value=t:this.value=this.max}},{key:"decrementValue",value:function(){var t=this.value-this.step;this.value>this.min&&(this.last_changed=Date.now(),this.temperatureStateInFlux(!0)),t>=this.min?this.value=t:this.value=this.min}},{key:"valueChanged",value:function(){var t=this;this.last_changed&&window.setTimeout((function(){Date.now()-t.last_changed>=2e3&&(t.fire("change"),t.temperatureStateInFlux(!1),t.last_changed=null)}),2010)}}])&&y(e.prototype,n),r&&y(e,r),i}((0,s.I)(i.H3));function g(t){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n <style include="iron-flex"></style>\n <style>\n :host {\n color: var(--primary-text-color);\n }\n\n ha-paper-dropdown-menu {\n width: 100%;\n }\n\n paper-item {\n cursor: pointer;\n }\n\n ha-water_heater-control.range-control-left,\n ha-water_heater-control.range-control-right {\n float: left;\n width: 46%;\n }\n ha-water_heater-control.range-control-left {\n margin-right: 4%;\n }\n ha-water_heater-control.range-control-right {\n margin-left: 4%;\n }\n\n .single-row {\n padding: 8px 0;\n }\n }\n </style>\n\n <div class$="[[computeClassNames(stateObj)]]">\n <div class="container-temperature">\n <div class$="[[stateObj.attributes.operation_mode]]">\n <div hidden$="[[!supportsTemperatureControls(stateObj)]]">\n [[localize(\'ui.card.water_heater.target_temperature\')]]\n </div>\n <template is="dom-if" if="[[supportsTemperature(stateObj)]]">\n <ha-water_heater-control\n value="[[stateObj.attributes.temperature]]"\n units="[[hass.config.unit_system.temperature]]"\n step="[[computeTemperatureStepSize(hass, stateObj)]]"\n min="[[stateObj.attributes.min_temp]]"\n max="[[stateObj.attributes.max_temp]]"\n on-change="targetTemperatureChanged"\n >\n </ha-water_heater-control>\n </template>\n </div>\n </div>\n\n <template is="dom-if" if="[[supportsOperationMode(stateObj)]]">\n <div class="container-operation_list">\n <div class="controls">\n <ha-paper-dropdown-menu\n label-float=""\n dynamic-align=""\n label="[[localize(\'ui.card.water_heater.operation\')]]"\n >\n <paper-listbox\n slot="dropdown-content"\n selected="[[stateObj.attributes.operation_mode]]"\n attr-for-selected="item-name"\n on-selected-changed="handleOperationmodeChanged"\n >\n <template\n is="dom-repeat"\n items="[[stateObj.attributes.operation_list]]"\n >\n <paper-item item-name$="[[item]]"\n >[[_localizeOperationMode(localize, item)]]</paper-item\n >\n </template>\n </paper-listbox>\n </ha-paper-dropdown-menu>\n </div>\n </div>\n </template>\n\n <template is="dom-if" if="[[supportsAwayMode(stateObj)]]">\n <div class="container-away_mode">\n <div class="center horizontal layout single-row">\n <div class="flex">\n [[localize(\'ui.card.water_heater.away_mode\')]]\n </div>\n <ha-switch\n checked="[[awayToggleChecked]]"\n on-change="awayToggleChanged"\n >\n </ha-switch>\n </div>\n </div>\n </template>\n </div>\n ']);return _=function(){return t},t}function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function j(t,e){return(j=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=x(t);if(e){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return k(this,n)}}function k(t,e){return!e||"object"!==g(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}customElements.define("ha-water_heater-control",v);var P=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&j(t,e)}(l,t);var e,n,i,s=S(l);function l(){return w(this,l),s.apply(this,arguments)}return e=l,i=[{key:"template",get:function(){return(0,a.d)(_())}},{key:"properties",get:function(){return{hass:{type:Object},stateObj:{type:Object,observer:"stateObjChanged"},awayToggleChecked:Boolean}}}],(n=[{key:"stateObjChanged",value:function(t,e){var n=this;t&&this.setProperties({awayToggleChecked:"on"===t.attributes.away_mode}),e&&(this._debouncer=o.d.debounce(this._debouncer,r.Wc.after(500),(function(){n.fire("iron-resize")})))}},{key:"computeTemperatureStepSize",value:function(t,e){return e.attributes.target_temp_step?e.attributes.target_temp_step:-1!==t.config.unit_system.temperature.indexOf("F")?1:.5}},{key:"supportsTemperatureControls",value:function(t){return this.supportsTemperature(t)}},{key:"supportsTemperature",value:function(t){return(0,c.e)(t,1)&&"number"==typeof t.attributes.temperature}},{key:"supportsOperationMode",value:function(t){return(0,c.e)(t,2)}},{key:"supportsAwayMode",value:function(t){return(0,c.e)(t,4)}},{key:"computeClassNames",value:function(t){var e=[(0,u.d)(t,{1:"has-target_temperature",2:"has-operation_mode",4:"has-away_mode"})];return e.push("more-info-water_heater"),e.join(" ")}},{key:"targetTemperatureChanged",value:function(t){var e=t.target.value;e!==this.stateObj.attributes.temperature&&this.callServiceHelper("set_temperature",{temperature:e})}},{key:"awayToggleChanged",value:function(t){var e="on"===this.stateObj.attributes.away_mode,n=t.target.checked;e!==n&&this.callServiceHelper("set_away_mode",{away_mode:n})}},{key:"handleOperationmodeChanged",value:function(t){var e=this.stateObj.attributes.operation_mode,n=t.detail.value;n&&e!==n&&this.callServiceHelper("set_operation_mode",{operation_mode:n})}},{key:"callServiceHelper",value:function(t,e){var n=this;e.entity_id=this.stateObj.entity_id,this.hass.callService("water_heater",t,e).then((function(){n.stateObjChanged(n.stateObj)}))}},{key:"_localizeOperationMode",value:function(t,e){return t("component.water_heater.state._.".concat(e))||e}}])&&O(e.prototype,n),i&&O(e,i),l}((0,n(1265).Z)((0,s.I)(i.H3)));customElements.define("more-info-water_heater",P)},11052:function(t,e,n){"use strict";n.d(e,{I:function(){return p}});var r=n(76389),o=n(47181);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f(t);if(e){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}function l(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=(0,r.o)((function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(l,t);var e,n,r,a=s(l);function l(){return i(this,l),a.apply(this,arguments)}return e=l,(n=[{key:"fire",value:function(t,e,n){return n=n||{},(0,o.B)(n.node||this,t,e,n)}}])&&u(e.prototype,n),r&&u(e,r),l}(t)}))}}]); //# sourceMappingURL=chunk.826b9968a8a26dda451d.js.map