iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 17.3 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9870],{89870:function(e,t,n){"use strict";n.r(t);n(53918);var r,i,o,a,s,c,l,d,u=n(50424),f=n(55358),p=n(83849),h=(n(54909),n(22098),n(99282),n(91810)),m=n(28575),y=(n(1359),n(11654)),v=(n(88165),n(27691)),b=n(47465);function w(e){return(w="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 k(e,t){return q(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||N(e,t)||F()}function g(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){g(o,r,i,a,s,"next",e)}function s(e){g(o,r,i,a,s,"throw",e)}a(void 0)}))}}function z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t=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 n,r=O(e);if(t){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return C(this,n)}}function C(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?S(e):t}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function I(){I=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!A(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,q(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||N(t)||F()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=B(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:R(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=R(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function D(e){var t,n=B(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function j(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function A(e){return e.decorators&&e.decorators.length}function T(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function R(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function B(e){var t=function(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===w(t)?t:String(t)}function F(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(e,t){if(e){if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(e,t):void 0}}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e){if(Array.isArray(e))return e}!function(e,t,n,r){var i=I();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(T(o.descriptor)||T(i.descriptor)){if(A(o)||A(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(A(o)){if(A(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}j(o,i)}else t.push(o)}return t}(a.d.map(D)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,f.Mo)("ozw-node-config")],(function(e,t){var n,w;return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(r,t);var n=x(r);function r(){var t;E(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(S(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,f.Cb)({type:Object})],key:"hass",value:void 0},{kind:"field",decorators:[(0,f.Cb)({type:Object})],key:"route",value:void 0},{kind:"field",decorators:[(0,f.Cb)({type:Boolean})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,f.Cb)({type:Boolean})],key:"isWide",value:void 0},{kind:"field",decorators:[(0,f.Cb)()],key:"configEntryId",value:void 0},{kind:"field",decorators:[(0,f.Cb)()],key:"ozwInstance",value:void 0},{kind:"field",decorators:[(0,f.Cb)()],key:"nodeId",value:void 0},{kind:"field",decorators:[(0,f.SB)()],key:"_node",value:void 0},{kind:"field",decorators:[(0,f.SB)()],key:"_metadata",value:void 0},{kind:"field",decorators:[(0,f.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,f.SB)()],key:"_error",value:void 0},{kind:"method",key:"firstUpdated",value:function(){this.ozwInstance?this.nodeId?this._fetchData():(0,p.c)("/config/ozw/network/".concat(this.ozwInstance,"/nodes"),{replace:!0}):(0,p.c)("/config/ozw/dashboard",{replace:!0})}},{kind:"method",key:"render",value:function(){var e,t;return this._error?(0,u.dy)(r||(r=z(["\n <hass-error-screen\n .hass=","\n .error=","\n ></hass-error-screen>\n "])),this.hass,this.hass.localize("ui.panel.config.ozw.node."+this._error)):(0,u.dy)(i||(i=z(["\n <hass-tabs-subpage\n .hass=","\n .narrow=","\n .route=","\n .tabs=","\n >\n <ha-config-section .narrow="," .isWide=",'>\n <div slot="header">\n ','\n </div>\n\n <div slot="introduction">\n ',"\n <p>\n <em>\n ","\n </em>\n </p>\n <p>\n Note: This panel is currently read-only. The ability to change\n values will come in a later update.\n </p>\n </div>\n ","\n </ha-config-section>\n </hass-tabs-subpage>\n "])),this.hass,this.narrow,this.route,(0,v.ozwNodeTabs)(this.ozwInstance,this.nodeId),this.narrow,this.isWide,this.hass.localize("ui.panel.config.ozw.node_config.header"),this.hass.localize("ui.panel.config.ozw.node_config.introduction"),this.hass.localize("ui.panel.config.ozw.node_config.help_source"),this._node?(0,u.dy)(o||(o=z(['\n <ha-card class="content">\n <div class="card-content">\n <b>\n ',"\n "," </b\n ><br />\n ",":\n ","<br />\n ",":\n ","\n ",'\n </div>\n <div class="card-actions">\n <mwc-button @click=',">\n ","\n </mwc-button>\n </div>\n </ha-card>\n\n ","\n ","\n "])),this._node.node_manufacturer_name,this._node.node_product_name,this.hass.localize("ui.panel.config.ozw.common.node_id"),this._node.node_id,this.hass.localize("ui.panel.config.ozw.common.query_stage"),this._node.node_query_stage,null!==(e=this._metadata)&&void 0!==e&&e.metadata.ProductManualURL?(0,u.dy)(a||(a=z([' <a\n href="','"\n >\n <p>\n ',"\n </p>\n </a>"])),this._metadata.metadata.ProductManualURL,this.hass.localize("ui.panel.config.ozw.node_metadata.product_manual")):"",this._refreshNodeClicked,this.hass.localize("ui.panel.config.ozw.refresh_node.button"),null!==(t=this._metadata)&&void 0!==t&&t.metadata.WakeupHelp?(0,u.dy)(s||(s=z(['\n <ha-card\n class="content"\n header="','"\n >\n <div class="card-content">\n <span class="secondary">\n ',"\n </span>\n <p>","</p>\n </div>\n </ha-card>\n "])),this.hass.localize("ui.panel.config.ozw.common.wakeup_instructions"),this.hass.localize("ui.panel.config.ozw.node_config.wakeup_help"),this._metadata.metadata.WakeupHelp):"",this._config?(0,u.dy)(c||(c=z(["\n ","\n "])),this._config.map((function(e){return(0,u.dy)(l||(l=z(['\n <ha-card class="content">\n <div class="card-content">\n <b>','</b><br />\n <span class="secondary">',"</span>\n <p>","</p>\n </div>\n </ha-card>\n "])),e.label,e.help,e.value)}))):""):"")}},{kind:"method",key:"_fetchData",value:(w=_(regeneratorRuntime.mark((function e(){var t,n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.ozwInstance&&this.nodeId){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,t=(0,h.Jl)(this.hass,this.ozwInstance,this.nodeId),n=(0,h.Lm)(this.hass,this.ozwInstance,this.nodeId),r=(0,h.ol)(this.hass,this.ozwInstance,this.nodeId),e.next=8,Promise.all([t,n,r]);case 8:i=e.sent,o=k(i,3),this._node=o[0],this._metadata=o[1],this._config=o[2],e.next=21;break;case 15:if(e.prev=15,e.t0=e.catch(2),e.t0.code!==m.Vc){e.next=20;break}return this._error=m.Vc,e.abrupt("return");case 20:throw e.t0;case 21:case"end":return e.stop()}}),e,this,[[2,15]])}))),function(){return w.apply(this,arguments)})},{kind:"method",key:"_refreshNodeClicked",value:(n=_(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,b.B)(this,{node_id:this.nodeId,ozw_instance:this.ozwInstance});case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[y.Qx,(0,u.iv)(d||(d=z(["\n .secondary {\n color: var(--secondary-text-color);\n font-size: 0.9em;\n }\n\n .content {\n margin-top: 24px;\n }\n\n .sectionHeader {\n position: relative;\n padding-right: 40px;\n }\n\n ha-card {\n margin: 0 auto;\n max-width: 600px;\n }\n\n [hidden] {\n display: none;\n }\n\n blockquote {\n display: block;\n background-color: #ddd;\n padding: 8px;\n margin: 8px 0;\n font-size: 0.9em;\n }\n\n blockquote em {\n font-size: 0.9em;\n margin-top: 6px;\n }\n "])))]}}]}}),u.oi)}}]);
//# sourceMappingURL=chunk.d70c5af56bd37911cfc5.js.map