UNPKG

iobroker.lovelace

Version:

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

2 lines 4.85 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[4433],{94433:function(t,n,e){"use strict";e.r(n);e(53918),e(21157),e(87772),e(30879),e(31206);var r=e(50856),i=e(28426);e(4940);function o(t){return(o="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 u(){var t=function(t,n){n||(n=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}}))}(['\n <style include="iron-flex"></style>\n <style>\n p {\n margin: 8px 0;\n }\n\n a {\n color: var(--primary-color);\n }\n\n p > img {\n max-width: 100%;\n }\n\n p.center {\n text-align: center;\n }\n\n p.error {\n color: #c62828;\n }\n\n p.submit {\n text-align: center;\n height: 41px;\n }\n\n ha-circular-progress {\n width: 14px;\n height: 14px;\n margin-right: 20px;\n }\n\n [hidden] {\n display: none;\n }\n </style>\n\n <div class="layout vertical">\n <template is="dom-if" if="[[isConfigurable]]">\n <ha-markdown\n breaks\n content="[[stateObj.attributes.description]]"\n ></ha-markdown>\n\n <p class="error" hidden$="[[!stateObj.attributes.errors]]">\n [[stateObj.attributes.errors]]\n </p>\n\n <template is="dom-repeat" items="[[stateObj.attributes.fields]]">\n <paper-input\n label="[[item.name]]"\n name="[[item.id]]"\n type="[[item.type]]"\n on-change="fieldChanged"\n ></paper-input>\n </template>\n\n <p class="submit" hidden$="[[!stateObj.attributes.submit_caption]]">\n <mwc-button\n raised=""\n disabled="[[isConfiguring]]"\n on-click="submitClicked"\n >\n <ha-circular-progress\n active="[[isConfiguring]]"\n hidden="[[!isConfiguring]]"\n alt="Configuring"\n ></ha-circular-progress>\n [[stateObj.attributes.submit_caption]]\n </mwc-button>\n </p>\n </template>\n </div>\n ']);return u=function(){return t},t}function a(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function c(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,n){return(s=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function f(t){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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,r=p(t);if(n){var i=p(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return l(this,e)}}function l(t,n){return!n||"object"!==o(n)&&"function"!=typeof n?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):n}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var b=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&s(t,n)}(l,t);var n,e,i,o=f(l);function l(){return a(this,l),o.apply(this,arguments)}return n=l,i=[{key:"template",get:function(){return(0,r.d)(u())}},{key:"properties",get:function(){return{stateObj:{type:Object},action:{type:String,value:"display"},isConfigurable:{type:Boolean,computed:"computeIsConfigurable(stateObj)"},isConfiguring:{type:Boolean,value:!1},fieldInput:{type:Object,value:function(){return{}}}}}}],(e=[{key:"computeIsConfigurable",value:function(t){return"configure"===t.state}},{key:"fieldChanged",value:function(t){var n=t.target;this.fieldInput[n.name]=n.value}},{key:"submitClicked",value:function(){var t={configure_id:this.stateObj.attributes.configure_id,fields:this.fieldInput};this.isConfiguring=!0,this.hass.callService("configurator","configure",t).then(function(){this.isConfiguring=!1}.bind(this),function(){this.isConfiguring=!1}.bind(this))}}])&&c(n.prototype,e),i&&c(n,i),l}(i.H3);customElements.define("more-info-configurator",b)}}]); //# sourceMappingURL=chunk.d1d5b512010a4a527956.js.map