iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 14.1 kB
JavaScript
/*! For license information please see chunk.b6eaf6e6273409786861.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[4570],{21157:function(e,n,t){"use strict";var i;t(65233);var l,a,r=(0,t(50856).d)(i||(l=['\n/* Most common used flex styles*/\n<dom-module id="iron-flex">\n <template>\n <style>\n .layout.horizontal,\n .layout.vertical {\n display: -ms-flexbox;\n display: -webkit-flex;\n display: flex;\n }\n\n .layout.inline {\n display: -ms-inline-flexbox;\n display: -webkit-inline-flex;\n display: inline-flex;\n }\n\n .layout.horizontal {\n -ms-flex-direction: row;\n -webkit-flex-direction: row;\n flex-direction: row;\n }\n\n .layout.vertical {\n -ms-flex-direction: column;\n -webkit-flex-direction: column;\n flex-direction: column;\n }\n\n .layout.wrap {\n -ms-flex-wrap: wrap;\n -webkit-flex-wrap: wrap;\n flex-wrap: wrap;\n }\n\n .layout.no-wrap {\n -ms-flex-wrap: nowrap;\n -webkit-flex-wrap: nowrap;\n flex-wrap: nowrap;\n }\n\n .layout.center,\n .layout.center-center {\n -ms-flex-align: center;\n -webkit-align-items: center;\n align-items: center;\n }\n\n .layout.center-justified,\n .layout.center-center {\n -ms-flex-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n }\n\n .flex {\n -ms-flex: 1 1 0.000000001px;\n -webkit-flex: 1;\n flex: 1;\n -webkit-flex-basis: 0.000000001px;\n flex-basis: 0.000000001px;\n }\n\n .flex-auto {\n -ms-flex: 1 1 auto;\n -webkit-flex: 1 1 auto;\n flex: 1 1 auto;\n }\n\n .flex-none {\n -ms-flex: none;\n -webkit-flex: none;\n flex: none;\n }\n </style>\n </template>\n</dom-module>\n/* Basic flexbox reverse styles */\n<dom-module id="iron-flex-reverse">\n <template>\n <style>\n .layout.horizontal-reverse,\n .layout.vertical-reverse {\n display: -ms-flexbox;\n display: -webkit-flex;\n display: flex;\n }\n\n .layout.horizontal-reverse {\n -ms-flex-direction: row-reverse;\n -webkit-flex-direction: row-reverse;\n flex-direction: row-reverse;\n }\n\n .layout.vertical-reverse {\n -ms-flex-direction: column-reverse;\n -webkit-flex-direction: column-reverse;\n flex-direction: column-reverse;\n }\n\n .layout.wrap-reverse {\n -ms-flex-wrap: wrap-reverse;\n -webkit-flex-wrap: wrap-reverse;\n flex-wrap: wrap-reverse;\n }\n </style>\n </template>\n</dom-module>\n/* Flexbox alignment */\n<dom-module id="iron-flex-alignment">\n <template>\n <style>\n /**\n * Alignment in cross axis.\n */\n .layout.start {\n -ms-flex-align: start;\n -webkit-align-items: flex-start;\n align-items: flex-start;\n }\n\n .layout.center,\n .layout.center-center {\n -ms-flex-align: center;\n -webkit-align-items: center;\n align-items: center;\n }\n\n .layout.end {\n -ms-flex-align: end;\n -webkit-align-items: flex-end;\n align-items: flex-end;\n }\n\n .layout.baseline {\n -ms-flex-align: baseline;\n -webkit-align-items: baseline;\n align-items: baseline;\n }\n\n /**\n * Alignment in main axis.\n */\n .layout.start-justified {\n -ms-flex-pack: start;\n -webkit-justify-content: flex-start;\n justify-content: flex-start;\n }\n\n .layout.center-justified,\n .layout.center-center {\n -ms-flex-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n }\n\n .layout.end-justified {\n -ms-flex-pack: end;\n -webkit-justify-content: flex-end;\n justify-content: flex-end;\n }\n\n .layout.around-justified {\n -ms-flex-pack: distribute;\n -webkit-justify-content: space-around;\n justify-content: space-around;\n }\n\n .layout.justified {\n -ms-flex-pack: justify;\n -webkit-justify-content: space-between;\n justify-content: space-between;\n }\n\n /**\n * Self alignment.\n */\n .self-start {\n -ms-align-self: flex-start;\n -webkit-align-self: flex-start;\n align-self: flex-start;\n }\n\n .self-center {\n -ms-align-self: center;\n -webkit-align-self: center;\n align-self: center;\n }\n\n .self-end {\n -ms-align-self: flex-end;\n -webkit-align-self: flex-end;\n align-self: flex-end;\n }\n\n .self-stretch {\n -ms-align-self: stretch;\n -webkit-align-self: stretch;\n align-self: stretch;\n }\n\n .self-baseline {\n -ms-align-self: baseline;\n -webkit-align-self: baseline;\n align-self: baseline;\n }\n\n /**\n * multi-line alignment in main axis.\n */\n .layout.start-aligned {\n -ms-flex-line-pack: start; /* IE10 */\n -ms-align-content: flex-start;\n -webkit-align-content: flex-start;\n align-content: flex-start;\n }\n\n .layout.end-aligned {\n -ms-flex-line-pack: end; /* IE10 */\n -ms-align-content: flex-end;\n -webkit-align-content: flex-end;\n align-content: flex-end;\n }\n\n .layout.center-aligned {\n -ms-flex-line-pack: center; /* IE10 */\n -ms-align-content: center;\n -webkit-align-content: center;\n align-content: center;\n }\n\n .layout.between-aligned {\n -ms-flex-line-pack: justify; /* IE10 */\n -ms-align-content: space-between;\n -webkit-align-content: space-between;\n align-content: space-between;\n }\n\n .layout.around-aligned {\n -ms-flex-line-pack: distribute; /* IE10 */\n -ms-align-content: space-around;\n -webkit-align-content: space-around;\n align-content: space-around;\n }\n </style>\n </template>\n</dom-module>\n/* Non-flexbox positioning helper styles */\n<dom-module id="iron-flex-factors">\n <template>\n <style>\n .flex,\n .flex-1 {\n -ms-flex: 1 1 0.000000001px;\n -webkit-flex: 1;\n flex: 1;\n -webkit-flex-basis: 0.000000001px;\n flex-basis: 0.000000001px;\n }\n\n .flex-2 {\n -ms-flex: 2;\n -webkit-flex: 2;\n flex: 2;\n }\n\n .flex-3 {\n -ms-flex: 3;\n -webkit-flex: 3;\n flex: 3;\n }\n\n .flex-4 {\n -ms-flex: 4;\n -webkit-flex: 4;\n flex: 4;\n }\n\n .flex-5 {\n -ms-flex: 5;\n -webkit-flex: 5;\n flex: 5;\n }\n\n .flex-6 {\n -ms-flex: 6;\n -webkit-flex: 6;\n flex: 6;\n }\n\n .flex-7 {\n -ms-flex: 7;\n -webkit-flex: 7;\n flex: 7;\n }\n\n .flex-8 {\n -ms-flex: 8;\n -webkit-flex: 8;\n flex: 8;\n }\n\n .flex-9 {\n -ms-flex: 9;\n -webkit-flex: 9;\n flex: 9;\n }\n\n .flex-10 {\n -ms-flex: 10;\n -webkit-flex: 10;\n flex: 10;\n }\n\n .flex-11 {\n -ms-flex: 11;\n -webkit-flex: 11;\n flex: 11;\n }\n\n .flex-12 {\n -ms-flex: 12;\n -webkit-flex: 12;\n flex: 12;\n }\n </style>\n </template>\n</dom-module>\n<dom-module id="iron-positioning">\n <template>\n <style>\n .block {\n display: block;\n }\n\n [hidden] {\n display: none ;\n }\n\n .invisible {\n visibility: hidden ;\n }\n\n .relative {\n position: relative;\n }\n\n .fit {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n\n body.fullbleed {\n margin: 0;\n height: 100vh;\n }\n\n .scroll {\n -webkit-overflow-scrolling: touch;\n overflow: auto;\n }\n\n /* fixed position */\n .fixed-bottom,\n .fixed-left,\n .fixed-right,\n .fixed-top {\n position: fixed;\n }\n\n .fixed-top {\n top: 0;\n left: 0;\n right: 0;\n }\n\n .fixed-right {\n top: 0;\n right: 0;\n bottom: 0;\n }\n\n .fixed-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n }\n\n .fixed-left {\n top: 0;\n bottom: 0;\n left: 0;\n }\n </style>\n </template>\n</dom-module>\n'],a||(a=l.slice(0)),i=Object.freeze(Object.defineProperties(l,{raw:{value:Object.freeze(a)}}))));r.setAttribute("style","display: none;"),document.head.appendChild(r.content)},24381:function(e,n,t){"use strict";t.d(n,{Q:function(){return i}});var i=function(e,n){return e?n.map((function(n){return n in e.attributes?"has-"+n:""})).filter((function(e){return""!==e})).join(" "):""}},24570:function(e,n,t){"use strict";t.r(n);t(21157),t(30879);var i,l=t(50856),a=t(28426),r=t(24381);t(94653),t(42952),t(1090);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function f(e,n,t){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,n,t){var i=function(e,n){for(;!Object.prototype.hasOwnProperty.call(e,n)&&null!==(e=m(e)););return e}(e,n);if(i){var l=Object.getOwnPropertyDescriptor(i,n);return l.get?l.get.call(t):l.value}})(e,n,t||e)}function u(e,n){return(u=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function c(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,i=m(e);if(n){var l=m(this).constructor;t=Reflect.construct(i,arguments,l)}else t=i.apply(this,arguments);return d(this,t)}}function d(e,n){return!n||"object"!==s(n)&&"function"!=typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&u(e,n)}(d,e);var n,t,a,s=c(d);function d(){var e;return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,d),(e=s.call(this)).is_ready=!1,e}return n=d,a=[{key:"template",get:function(){return(0,l.d)(i||(e=['\n <div class$="[[computeClassNames(stateObj)]]">\n <template is="dom-if" if="[[doesHaveDate(stateObj)]]" restamp="">\n <div>\n <ha-date-input\n id="dateInput"\n label="Date"\n value="{{selectedDate}}"\n ></ha-date-input>\n </div>\n </template>\n <template is="dom-if" if="[[doesHaveTime(stateObj)]]" restamp="">\n <div>\n <paper-time-input\n hour="{{selectedHour}}"\n min="{{selectedMinute}}"\n format="24"\n ></paper-time-input>\n </div>\n </template>\n </div>\n '],n||(n=e.slice(0)),i=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))));var e,n}},{key:"properties",get:function(){return{hass:{type:Object},stateObj:{type:Object,observer:"stateObjChanged"},selectedDate:{type:String,observer:"dateTimeChanged"},selectedHour:{type:Number,observer:"dateTimeChanged"},selectedMinute:{type:Number,observer:"dateTimeChanged"}}}}],(t=[{key:"ready",value:function(){f(m(d.prototype),"ready",this).call(this),this.is_ready=!0}},{key:"getDateString",value:function(e){return"unknown"===e.state?"":(n=e.attributes.month<10?"0":"",t=e.attributes.day<10?"0":"",e.attributes.year+"-"+n+e.attributes.month+"-"+t+e.attributes.day);var n,t}},{key:"dateTimeChanged",value:function(){if(this.is_ready){var e,n=!1,t={entity_id:this.stateObj.entity_id};if(this.stateObj.attributes.has_time){n=(n=n||parseInt(this.selectedMinute)!==this.stateObj.attributes.minute)||parseInt(this.selectedHour)!==this.stateObj.attributes.hour,e=this.selectedMinute<10?"0":"";var i=this.selectedHour+":"+e+this.selectedMinute;t.time=i}if(this.stateObj.attributes.has_date){if(0===this.selectedDate.length)return;var l=new Date(this.selectedDate),a=new Date(this.stateObj.attributes.year,this.stateObj.attributes.month-1,this.stateObj.attributes.day);n=n||a!==l,t.date=this.selectedDate}n&&this.hass.callService("input_datetime","set_datetime",t)}}},{key:"stateObjChanged",value:function(e){this.is_ready=!1,e.attributes.has_time&&(this.selectedHour=e.attributes.hour,this.selectedMinute=e.attributes.minute),e.attributes.has_date&&(this.selectedDate=this.getDateString(e)),this.is_ready=!0}},{key:"doesHaveDate",value:function(e){return e.attributes.has_date}},{key:"doesHaveTime",value:function(e){return e.attributes.has_time}},{key:"computeClassNames",value:function(e){return"more-info-input_datetime "+(0,r.Q)(e,["has_time","has_date"])}}])&&o(n.prototype,t),a&&o(n,a),d}(a.H3);customElements.define("more-info-input_datetime",x)}}]);
//# sourceMappingURL=chunk.b6eaf6e6273409786861.js.map