iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 44.9 kB
JavaScript
/*! For license information please see chunk.8807e3794c9fd10dc9f2.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[3245],{63207:function(e,t,n){"use strict";n(65660),n(15112);var r,i,o,a=n(9672),s=n(87156),c=n(50856),u=n(65233);(0,a.k)({_template:(0,c.d)(r||(i=["\n <style>\n :host {\n @apply --layout-inline;\n @apply --layout-center-center;\n position: relative;\n\n vertical-align: middle;\n\n fill: var(--iron-icon-fill-color, currentcolor);\n stroke: var(--iron-icon-stroke-color, none);\n\n width: var(--iron-icon-width, 24px);\n height: var(--iron-icon-height, 24px);\n @apply --iron-icon;\n }\n\n :host([hidden]) {\n display: none;\n }\n </style>\n"],o||(o=i.slice(0)),r=Object.freeze(Object.defineProperties(i,{raw:{value:Object.freeze(o)}})))),is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:u.XY.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(e){var t=(e||"").split(":");this._iconName=t.pop(),this._iconsetName=t.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(e){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&(0,s.vz)(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,(0,s.vz)(this.root).appendChild(this._img))}})},15112:function(e,t,n){"use strict";n.d(t,{P:function(){return o}});n(65233);var r=n(9672);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),e[" "](t),this.type=t&&t.type||"default",this.key=t&&t.key,t&&"value"in t&&(this.value=t.value)}var t,n,r;return t=e,(n=[{key:"value",get:function(){var t=this.type,n=this.key;if(t&&n)return e.types[t]&&e.types[t][n]},set:function(t){var n=this.type,r=this.key;n&&r&&(n=e.types[n]=e.types[n]||{},null==t?delete n[r]:n[r]=t)}},{key:"list",get:function(){if(this.type){var t=e.types[this.type];return t?Object.keys(t).map((function(e){return a[this.type][e]}),this):[]}}},{key:"byKey",value:function(e){return this.key=e,this.value}}])&&i(t.prototype,n),r&&i(t,r),e}();o[" "]=function(){},o.types={};var a=o.types;(0,r.k)({is:"iron-meta",properties:{type:{type:String,value:"default"},key:{type:String},value:{type:String,notify:!0},self:{type:Boolean,observer:"_selfChanged"},__meta:{type:Boolean,computed:"__computeMeta(type, key, value)"}},hostAttributes:{hidden:!0},__computeMeta:function(e,t,n){var r=new o({type:e,key:t});return void 0!==n&&n!==r.value?r.value=n:this.value!==r.value&&(this.value=r.value),r},get list(){return this.__meta&&this.__meta.list},_selfChanged:function(e){e&&(this.value=this)},byKey:function(e){return new o({type:this.type,key:e}).value}})},98626:function(e,t,n){"use strict";function r(e){return new Promise((function(t,n){e.oncomplete=e.onsuccess=function(){return t(e.result)},e.onabort=e.onerror=function(){return n(e.error)}}))}function i(e,t){var n=indexedDB.open(e);n.onupgradeneeded=function(){return n.result.createObjectStore(t)};var i=r(n);return function(e,n){return i.then((function(r){return n(r.transaction(t,e).objectStore(t))}))}}var o;function a(){return o||(o=i("keyval-store","keyval")),o}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a();return t("readonly",(function(t){return r(t.get(e))}))}function c(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a();return n("readwrite",(function(n){return n.put(t,e),r(n.transaction)}))}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a();return e("readwrite",(function(e){return e.clear(),r(e.transaction)}))}n.d(t,{ZH:function(){return u},MT:function(){return i},U2:function(){return s},RV:function(){return r},t8:function(){return c}})},76666:function(e,t,n){"use strict";n.d(t,{$:function(){return r.$}});var r=n(81471)},27269:function(e,t,n){"use strict";n.d(t,{p:function(){return r}});var r=function(e){return e.substr(e.indexOf(".")+1)}},91741:function(e,t,n){"use strict";n.d(t,{C:function(){return i}});var r=n(27269),i=function(e){return void 0===e.attributes.friendly_name?(0,r.p)(e.entity_id).replace(/_/g," "):e.attributes.friendly_name||""}},85415:function(e,t,n){"use strict";n.d(t,{q:function(){return r},w:function(){return i}});var r=function(e,t){return e<t?-1:e>t?1:0},i=function(e,t){return r(e.toLowerCase(),t.toLowerCase())}},73728:function(e,t,n){"use strict";n.d(t,{pV:function(){return a},P3:function(){return s},Ky:function(){return u},D4:function(){return l},XO:function(){return d},zO:function(){return f},oi:function(){return p},d4:function(){return h},D7:function(){return m},ZJ:function(){return y},V3:function(){return g},WW:function(){return w}});var r=n(95282),i=n(38346),o=n(5986),a=["unignore","dhcp","homekit","ssdp","zeroconf","discovery","mqtt","hassio"],s=["reauth"],c={"HA-Frontend-Base":"".concat(location.protocol,"//").concat(location.host)},u=function(e,t){var n;return e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(null===(n=e.userData)||void 0===n?void 0:n.showAdvanced)},c)},l=function(e,t){return e.callApi("GET","config/config_entries/flow/".concat(t),void 0,c)},d=function(e,t,n){return e.callApi("POST","config/config_entries/flow/".concat(t),n,c)},f=function(e,t,n){return e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:n})},p=function(e,t){return e.callApi("DELETE","config/config_entries/flow/".concat(t))},h=function(e){return e.callApi("GET","config/config_entries/flow_handlers")},m=function(e){return e.sendMessagePromise({type:"config_entries/flow/progress"})},v=function(e,t){return e.subscribeEvents((0,i.D)((function(){return m(e).then((function(e){return t.setState(e,!0)}))}),500,!0),"config_entry_discovered")},y=function(e){return(0,r._)(e,"_configFlowProgress",m,v)},g=function(e,t){return y(e.connection).subscribe(t)},w=function(e,t){var n=t.context.title_placeholders||{},r=Object.keys(n);if(0===r.length)return(0,o.Lh)(e,t.handler);var i=[];return r.forEach((function(e){i.push(e),i.push(n[e])})),e.apply(void 0,["component.".concat(t.handler,".config.flow_title")].concat(i))}},57292:function(e,t,n){"use strict";n.d(t,{jL:function(){return c},t1:function(){return u},q4:function(){return f}});var r=n(95282),i=n(91741),o=n(38346);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function s(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}var c=function(e,t,n){return e.name_by_user||e.name||n&&function(e,t){var n,r=a(t||[]);try{for(r.s();!(n=r.n()).done;){var o=n.value,s="string"==typeof o?o:o.entity_id,c=e.states[s];if(c)return(0,i.C)(c)}}catch(u){r.e(u)}finally{r.f()}}(t,n)||t.localize("ui.panel.config.devices.unnamed_device")},u=function(e,t,n){return e.callWS(Object.assign({type:"config/device_registry/update",device_id:t},n))},l=function(e){return e.sendMessagePromise({type:"config/device_registry/list"})},d=function(e,t){return e.subscribeEvents((0,o.D)((function(){return l(e).then((function(e){return t.setState(e,!0)}))}),500,!0),"device_registry_updated")},f=function(e,t){return(0,r.B)("_dr",l,d,e,t)}},91810:function(e,t,n){"use strict";n.d(t,{YJ:function(){return r},ID:function(){return i},Kk:function(){return o},$c:function(){return a},WI:function(){return s},vY:function(){return c},uZ:function(){return u},cC:function(){return l},e8:function(){return d},Jl:function(){return f},Lm:function(){return p},ol:function(){return h},x1:function(){return m}});var r=["ProtocolInfo","Probe","WakeUp","ManufacturerSpecific1","NodeInfo","NodePlusInfo","ManufacturerSpecific2","Versions","Instances","Static","CacheLoad","Associations","Neighbors","Session","Dynamic","Configuration","Complete"],i=["driverAllNodesQueried","driverAllNodesQueriedSomeDead","driverAwakeNodesQueried"],o=["starting","started","Ready","driverReady"],a=["Offline","stopped","driverFailed","driverReset","driverRemoved","driverAllNodesOnFire"],s=function(e){if(e){var t=e.identifiers.find((function(e){return"ozw"===e[0]}));if(t){var n=t[1].split(".");return{node_id:parseInt(n[1]),ozw_instance:parseInt(n[0])}}}},c=function(e){return e.callWS({type:"ozw/get_instances"})},u=function(e,t){return e.callWS({type:"ozw/network_status",ozw_instance:t})},l=function(e,t){return e.callWS({type:"ozw/network_statistics",ozw_instance:t})},d=function(e,t){return e.callWS({type:"ozw/get_nodes",ozw_instance:t})},f=function(e,t,n){return e.callWS({type:"ozw/node_status",ozw_instance:t,node_id:n})},p=function(e,t,n){return e.callWS({type:"ozw/node_metadata",ozw_instance:t,node_id:n})},h=function(e,t,n){return e.callWS({type:"ozw/get_config_parameters",ozw_instance:t,node_id:n})},m=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.callWS({type:"ozw/migrate_zwave",dry_run:t})}},60633:function(e,t,n){"use strict";n.d(t,{N8:function(){return r},E0:function(){return i},PH:function(){return o},BM:function(){return a},HV:function(){return s},MI:function(){return c},qc:function(){return u},fQ:function(){return l}});var r=0,i=5,o=7,a=10,s=function(e){return e.callWS({type:"zwave/network_status"})},c=function(e){return e.callWS({type:"zwave/start_ozw_config_flow"})},u=function(e){return e.callWS({type:"zwave/get_migration_config"})},l=function(e,t){return e.callApi("GET","zwave/config/".concat(t))}},2852:function(e,t,n){"use strict";n.d(t,{t:function(){return _}});var r,i,o,a,s,c,u,l=n(50424),d=n(85415),f=n(73728),p=n(5986),h=n(52871);function m(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function v(e,t){return function(e){if(Array.isArray(e))return e}(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)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e,t)||function(){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 y(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 g(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,i)}function w(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)}))}}var _=function(e,t){return(0,h.w)(e,t,{loadDevicesAndAreas:!0,getFlowHandlers:(g=w(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([(0,f.d4)(t),t.loadBackendTranslation("title",void 0,!0)]);case 2:return n=e.sent,r=v(n,1),i=r[0],e.abrupt("return",i.sort((function(e,n){return(0,d.w)((0,p.Lh)(t.localize,e),(0,p.Lh)(t.localize,n))})));case 6:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)}),createFlow:(y=w(regeneratorRuntime.mark((function e(t,n){var r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([(0,f.Ky)(t,n),t.loadBackendTranslation("config",n)]);case 2:return r=e.sent,i=v(r,1),o=i[0],e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return y.apply(this,arguments)}),fetchFlow:(n=w(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.D4)(t,n);case 2:return r=e.sent,e.next=5,t.loadBackendTranslation("config",r.handler);case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)}),handleFlowStep:f.XO,deleteFlow:f.oi,renderAbortDescription:function(e,t){var n=e.localize("component.".concat(t.handler,".config.abort.").concat(t.reason),t.description_placeholders);return n?(0,l.dy)(r||(r=m(["\n <ha-markdown allowsvg breaks .content=","></ha-markdown>\n "])),n):""},renderShowFormStepHeader:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".title"))||e.localize("component.".concat(t.handler,".title"))},renderShowFormStepDescription:function(e,t){var n=e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".description"),t.description_placeholders);return n?(0,l.dy)(i||(i=m(["\n <ha-markdown allowsvg breaks .content=","></ha-markdown>\n "])),n):""},renderShowFormStepFieldLabel:function(e,t,n){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".data.").concat(n.name))},renderShowFormStepFieldError:function(e,t,n){return e.localize("component.".concat(t.handler,".config.error.").concat(n))},renderExternalStepHeader:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".title"))||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site")},renderExternalStepDescription:function(e,t){var n=e.localize("component.".concat(t.handler,".config.").concat(t.step_id,".description"),t.description_placeholders);return(0,l.dy)(o||(o=m(["\n <p>\n ","\n </p>\n ","\n "])),e.localize("ui.panel.config.integrations.config_flow.external_step.description"),n?(0,l.dy)(a||(a=m(["\n <ha-markdown\n allowsvg\n breaks\n .content=","\n ></ha-markdown>\n "])),n):"")},renderCreateEntryDescription:function(e,t){var n=e.localize("component.".concat(t.handler,".config.create_entry.").concat(t.description||"default"),t.description_placeholders);return(0,l.dy)(s||(s=m(["\n ","\n <p>\n ","\n </p>\n "])),n?(0,l.dy)(c||(c=m(["\n <ha-markdown\n allowsvg\n breaks\n .content=","\n ></ha-markdown>\n "])),n):"",e.localize("ui.panel.config.integrations.config_flow.created_config","name",t.title))},renderShowFormProgressHeader:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".title"))||e.localize("component.".concat(t.handler,".title"))},renderShowFormProgressDescription:function(e,t){var n=e.localize("component.".concat(t.handler,".config.progress.").concat(t.progress_action),t.description_placeholders);return n?(0,l.dy)(u||(u=m(["\n <ha-markdown allowsvg breaks .content=","></ha-markdown>\n "])),n):""}});var n,y,g}},52871:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(47181),i=function(){return Promise.all([n.e(5009),n.e(2955),n.e(8161),n.e(1041),n.e(8200),n.e(3967),n.e(879),n.e(1657),n.e(4444),n.e(2296),n.e(6002),n.e(486),n.e(1480),n.e(5230),n.e(3763),n.e(5569),n.e(577),n.e(6509),n.e(4821),n.e(7164),n.e(8331),n.e(8101),n.e(4940),n.e(4482)]).then(n.bind(n,27234))},o=function(e,t,n){(0,r.B)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:i,dialogParams:Object.assign({},t,{flowConfig:n})})}},41896:function(e,t,n){"use strict";n.r(t),n.d(t,{ZwaveMigration:function(){return X}});n(53918),n(53268),n(12730);var r,i,o,a,s,c,u,l,d,f,p,h,m,v,y,g,w,_,k,b,S,z=n(50424),E=n(55358),O=n(7323),D=n(91741),x=n(83849),C=(n(94132),n(54909),n(22098),n(31206),n(16509),n(10983),n(57292)),A=n(91810),P=n(60633),T=n(2852),j=n(26765),W=(n(60010),n(11654));n(88165);function I(e){return(I="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 N(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,i)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){N(o,r,i,a,s,"next",e)}function s(e){N(o,r,i,a,s,"throw",e)}a(void 0)}))}}function M(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(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=q(e);if(t){var i=q(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return L(this,n)}}function L(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?H(e):t}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Q(){Q=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(!Y(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 u=c.extras;if(u){for(var l=0;l<u.length;l++)this.addElementPlacement(u[l],t);n.push.apply(n,u)}}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,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return J(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)?J(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).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=G(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:$(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=$(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 U(e){var t,n=G(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 K(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Y(e){return e.decorators&&e.decorators.length}function V(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function $(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 G(e){var t=function(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===I(t)?t:String(t)}function J(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}var X=function(e,t,n,r){var i=Q();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(V(o.descriptor)||V(i.descriptor)){if(Y(o)||Y(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(Y(o)){if(Y(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}K(o,i)}else t.push(o)}return t}(a.d.map(U)),e);return i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,E.Mo)("zwave-migration")],(function(e,t){var n,I,N,L,q,Q,U;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&&F(e,t)}(r,t);var n=B(r);function r(){var t;Z(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(H(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,E.Cb)({type:Object})],key:"hass",value:void 0},{kind:"field",decorators:[(0,E.Cb)({type:Object})],key:"route",value:void 0},{kind:"field",decorators:[(0,E.Cb)({type:Boolean})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,E.Cb)({type:Boolean})],key:"isWide",value:void 0},{kind:"field",decorators:[(0,E.SB)()],key:"_networkStatus",value:void 0},{kind:"field",decorators:[(0,E.SB)()],key:"_step",value:function(){return 0}},{kind:"field",decorators:[(0,E.SB)()],key:"_stoppingNetwork",value:function(){return!1}},{kind:"field",decorators:[(0,E.SB)()],key:"_migrationConfig",value:void 0},{kind:"field",decorators:[(0,E.SB)()],key:"_migrationData",value:void 0},{kind:"field",decorators:[(0,E.SB)()],key:"_migratedZwaveEntities",value:void 0},{kind:"field",decorators:[(0,E.SB)()],key:"_deviceNameLookup",value:function(){return{}}},{kind:"field",key:"_unsub",value:void 0},{kind:"field",key:"_unsubDevices",value:void 0},{kind:"method",key:"disconnectedCallback",value:function(){this._unsubscribe(),this._unsubDevices&&(this._unsubDevices(),this._unsubDevices=void 0)}},{kind:"method",key:"render",value:function(){var e=this;return(0,z.dy)(r||(r=M(["\n <hass-subpage\n .hass=","\n .narrow=","\n .route=",'\n back-path="/config/zwave"\n >\n <ha-config-section .narrow='," .isWide=",'>\n <div slot="header">\n ','\n </div>\n\n <div slot="introduction">\n ',"\n </div>\n ","\n </ha-config-section>\n </hass-subpage>\n "])),this.hass,this.narrow,this.route,this.narrow,this.isWide,this.hass.localize("ui.panel.config.zwave.migration.ozw.header"),this.hass.localize("ui.panel.config.zwave.migration.ozw.introduction"),(0,O.p)(this.hass,"hassio")||(0,O.p)(this.hass,"mqtt")?(0,z.dy)(o||(o=M(["\n ","\n ","\n ","\n ","\n ","\n "])),0===this._step?(0,z.dy)(a||(a=M(['\n <ha-card class="content" header="Introduction">\n <div class="card-content">\n <p>\n This wizard will walk through the following steps to\n migrate from the legacy Z-Wave integration to\n OpenZWave.\n </p>\n <ol>\n <li>Stop the Z-Wave network</li>\n <li>\n <i\n >If running ioBroker Core in Docker or in\n Python venv:</i\n >\n Configure and start OZWDaemon\n </li>\n <li>Set up the OpenZWave integration</li>\n <li>\n Migrate entities and devices to the new\n integration\n </li>\n <li>Remove legacy Z-Wave integration</li>\n </ol>\n <p>\n <b>\n Please take a backup or a snapshot of your\n environment before proceeding.\n </b>\n </p>\n </div>\n <div class="card-actions">\n <mwc-button @click=',">\n Continue\n </mwc-button>\n </div>\n </ha-card>\n "])),this._continue):"",1===this._step?(0,z.dy)(s||(s=M(['\n <ha-card class="content" header="Stop Z-Wave Network">\n <div class="card-content">\n <p>\n We need to stop the Z-Wave network to perform the\n migration. ioBroker will not be able to\n control Z-Wave devices while the network is stopped.\n </p>\n ','\n </div>\n <div class="card-actions">\n <mwc-button @click=',">\n Stop Network\n </mwc-button>\n </div>\n </ha-card>\n "])),this._stoppingNetwork?(0,z.dy)(c||(c=M(['\n <div class="flex-container">\n <ha-circular-progress\n active\n ></ha-circular-progress>\n <div><p>Stopping Z-Wave Network...</p></div>\n </div>\n ']))):"",this._stopNetwork):"",2===this._step?(0,z.dy)(u||(u=M(['\n <ha-card class="content" header="Set up OZWDaemon">\n <div class="card-content">\n <p>Now it\'s time to set up the OZW integration.</p>\n ','\n </div>\n <div class="card-actions">\n <mwc-button @click=',">\n Continue\n </mwc-button>\n </div>\n </ha-card>\n "])),(0,O.p)(this.hass,"hassio")?(0,z.dy)(l||(l=M(["\n <p>\n The OZWDaemon runs in a ioBroker addon\n that will be setup next. Make sure to check\n the checkbox for the addon.\n </p>\n "]))):(0,z.dy)(d||(d=M(['\n <p>\n If you\'re using ioBroker Core in Docker\n or a Python venv, see the\n <a\n href="https://github.com/OpenZWave/qt-openzwave/blob/master/README.md"\n target="_blank"\n rel="noreferrer"\n >\n OZWDaemon readme\n </a>\n for setup instructions.\n </p>\n <p>\n Here\'s the current Z-Wave configuration.\n You\'ll need these values when setting up OZW\n daemon.\n </p>\n ',"\n <p>\n Once OZWDaemon is installed, running, and\n connected to the MQTT broker click Continue to\n set up the OpenZWave integration and migrate\n your devices and entities.\n </p>\n "])),this._migrationConfig?(0,z.dy)(f||(f=M([" <blockquote>\n USB Path:\n ","<br />\n Network Key:\n ","\n </blockquote>"])),this._migrationConfig.usb_path,this._migrationConfig.network_key):""),this._setupOzw):"",3===this._step?(0,z.dy)(p||(p=M(['\n <ha-card\n class="content"\n header="Migrate devices and entities"\n >\n <div class="card-content">\n <p>\n Now it\'s time to migrate your devices and entities\n from the legacy Z-Wave integration to the OZW\n integration, to make sure all your UI and\n automations keep working.\n </p>\n ','\n </div>\n <div class="card-actions">\n <mwc-button @click=',">\n Migrate\n </mwc-button>\n </div>\n </ha-card>\n "])),this._migrationData?(0,z.dy)(h||(h=M(["\n <p>Below is a list of what will be migrated.</p>\n ","\n ","\n ","\n "])),this._migratedZwaveEntities.length!==this._migrationData.zwave_entity_ids.length?(0,z.dy)(m||(m=M(['<h3 class="warning">\n Not all entities can be migrated! The\n following entities will not be migrated\n and might need manual adjustments to\n your config:\n </h3>\n <ul>\n ',"\n </ul>"])),this._migrationData.zwave_entity_ids.map((function(t){return e._migratedZwaveEntities.includes(t)?"":(0,z.dy)(v||(v=M(["<li>\n ","\n (",")\n </li>"])),(0,D.C)(e.hass.states[t]),t)}))):"",Object.keys(this._migrationData.migration_device_map).length?(0,z.dy)(y||(y=M(["<h3>Devices that will be migrated:</h3>\n <ul>\n ","\n </ul>"])),Object.keys(this._migrationData.migration_device_map).map((function(t){return(0,z.dy)(g||(g=M(["<li>\n ","\n </li>"])),e._deviceNameLookup[t]||t)}))):"",Object.keys(this._migrationData.migration_entity_map).length?(0,z.dy)(w||(w=M(["<h3>\n Entities that will be migrated:\n </h3>\n <ul>\n ","\n </ul>"])),Object.keys(this._migrationData.migration_entity_map).map((function(t){return(0,z.dy)(_||(_=M(["<li>\n ","\n (",")\n </li>"])),(0,D.C)(e.hass.states[t]),t)}))):""):(0,z.dy)(k||(k=M([' <div class="flex-container">\n <p>Loading migration data...</p>\n <ha-circular-progress active>\n </ha-circular-progress>\n </div>']))),this._doMigrate):"",4===this._step?(0,z.dy)(b||(b=M(['<ha-card class="content" header="Done!">\n <div class="card-content">\n That was all! You are now migrated to the new OZW\n integration, check if all your devices and entities are\n back the way they where, if not all entities could be\n migrated you might have to change those manually.\n </div>\n <div class="card-actions">\n <mwc-button @click=',">\n Go to OZW config panel\n </mwc-button>\n </div>\n </ha-card>"])),this._navigateOzw):""):(0,z.dy)(i||(i=M(['\n <ha-card class="content" header="MQTT Required">\n <div class="card-content">\n <p>\n OpenZWave requires MQTT. Please setup an MQTT broker and\n the MQTT integration to proceed with the migration.\n </p>\n </div>\n </ha-card>\n ']))))}},{kind:"method",key:"_getMigrationConfig",value:(U=R(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,P.qc)(this.hass);case 2:this._migrationConfig=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{kind:"method",key:"_unsubscribe",value:(Q=R(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._unsub){e.next=6;break}return e.next=3,this._unsub;case 3:e.t0=e.sent,(0,e.t0)(),this._unsub=void 0;case 6:case"end":return e.stop()}}),e,this)}))),function(){return Q.apply(this,arguments)})},{kind:"method",key:"_continue",value:function(){this._step++}},{kind:"method",key:"_stopNetwork",value:(q=R(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._stoppingNetwork=!0,e.next=3,this._getNetworkStatus();case 3:if((null===(t=this._networkStatus)||void 0===t?void 0:t.state)!==P.N8){e.next=6;break}return this._networkStopped(),e.abrupt("return");case 6:this._unsub=this.hass.connection.subscribeEvents((function(){return n._networkStopped()}),"zwave.network_stop"),this.hass.callService("zwave","stop_network");case 8:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{kind:"method",key:"_setupOzw",value:(L=R(regeneratorRuntime.mark((function e(){var t,n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,P.MI)(this.hass);case 2:if(n=e.sent,!(0,O.p)(this.hass,"ozw")){e.next=7;break}return this._getMigrationData(),this._step=3,e.abrupt("return");case 7:(0,T.t)(this,{continueFlowId:n.flow_id,dialogClosedCallback:function(){(0,O.p)(r.hass,"ozw")&&(r._getMigrationData(),r._step=3)},showAdvanced:null===(t=this.hass.userData)||void 0===t?void 0:t.showAdvanced}),this.hass.loadBackendTranslation("title","ozw",!0);case 9:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{kind:"method",key:"_getMigrationData",value:(N=R(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,A.x1)(this.hass,!0);case 3:this._migrationData=e.sent,e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),(0,j.Ys)(this,{title:"Failed to get migration data!",text:"unknown_command"===e.t0.code?"Restart ioBroker and try again.":e.t0.message}),e.abrupt("return");case 10:this._migratedZwaveEntities=Object.keys(this._migrationData.migration_entity_map),Object.keys(this._migrationData.migration_device_map).length&&this._fetchDevices();case 12:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return N.apply(this,arguments)})},{kind:"method",key:"_fetchDevices",value:function(){var e=this;this._unsubDevices=(0,C.q4)(this.hass.connection,(function(t){if(e._migrationData){var n=Object.keys(e._migrationData.migration_device_map),r={};t.forEach((function(t){n.includes(t.id)&&(r[t.id]=(0,C.jL)(t,e.hass))})),e._deviceNameLookup=r}}))}},{kind:"method",key:"_doMigrate",value:(I=R(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,A.x1)(this.hass,!1);case 2:if(e.sent.migrated){e.next=6;break}return(0,j.Ys)(this,{title:"Migration failed!"}),e.abrupt("return");case 6:this._step=4;case 7:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{kind:"method",key:"_navigateOzw",value:function(){(0,x.c)("/config/ozw")}},{kind:"method",key:"_networkStopped",value:function(){this._unsubscribe(),this._getMigrationConfig(),this._stoppingNetwork=!1,this._step=2}},{kind:"method",key:"_getNetworkStatus",value:(n=R(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,P.HV)(this.hass);case 2:this._networkStatus=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[W.Qx,(0,z.iv)(S||(S=M(["\n .content {\n margin-top: 24px;\n }\n\n .flex-container {\n display: flex;\n align-items: center;\n }\n\n .flex-container ha-circular-progress {\n margin-right: 20px;\n }\n\n blockquote {\n display: block;\n background-color: var(--secondary-background-color);\n color: var(--primary-text-color);\n padding: 8px;\n margin: 8px 0;\n font-size: 0.9em;\n font-family: monospace;\n }\n\n ha-card {\n margin: 0 auto;\n max-width: 600px;\n }\n "])))]}}]}}),z.oi)}}]);
//# sourceMappingURL=chunk.8807e3794c9fd10dc9f2.js.map