UNPKG

iobroker.lovelace

Version:

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

2 lines 18 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[477],{54211:function(e,r){"use strict";r.N=void 0;var t=/^(%20|\s)*(javascript|data|vbscript)/im,n=/[\u0000-\u001F\u007F-\u009F]/gim,o=/^([^:]+):/gm,i=[".","/"];r.N=function(e){if(!e)return"about:blank";var r=e.replace(n,"").trim();if(function(e){return i.indexOf(e[0])>-1}(r))return r;var a=r.match(o);if(!a)return r;var c=a[0];return t.test(c)?"about:blank":r}},7323:function(e,r,t){"use strict";t.d(r,{p:function(){return n}});var n=function(e,r){return e&&e.config.components.includes(r)}},15493:function(e,r,t){"use strict";function n(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==t)return;var n,o,i=[],a=!0,c=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(s){c=!0,o=s}finally{try{a||null==t.return||t.return()}finally{if(c)throw o}}return i}(e,r)||o(e,r)||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 o(e,r){if(e){if("string"==typeof e)return i(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,r):void 0}}function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}t.d(r,{Q2:function(){return a},io:function(){return c},ou:function(){return s},j4:function(){return l},pc:function(){return u}});var a=function(){var e,r={},t=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=o(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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 a,c=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==t.return||t.return()}finally{if(s)throw a}}}}(new URLSearchParams(location.search).entries());try{for(t.s();!(e=t.n()).done;){var i=n(e.value,2),a=i[0],c=i[1];r[a]=c}}catch(s){t.e(s)}finally{t.f()}return r},c=function(e){return new URLSearchParams(window.location.search).get(e)},s=function(e){var r=new URLSearchParams;return Object.entries(e).forEach((function(e){var t=n(e,2),o=t[0],i=t[1];r.append(o,i)})),r.toString()},l=function(e){var r=new URLSearchParams(window.location.search);return Object.entries(e).forEach((function(e){var t=n(e,2),o=t[0],i=t[1];r.set(o,i)})),r.toString()},u=function(e){var r=new URLSearchParams(window.location.search);return r.delete(e),r.toString()}},60477:function(e,r,t){"use strict";t.r(r);var n,o,i,a,c=t(54211),s=t(50424),l=t(55358),u=t(7323),f=t(83849),d=t(15493),p=t(5986),h=(t(48811),t(27322));function m(e){return(m="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 v(e,r){return D(e)||function(e,r){var t=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==t)return;var n,o,i=[],a=!0,c=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(s){c=!0,o=s}finally{try{a||null==t.return||t.return()}finally{if(c)throw o}}return i}(e,r)||R(e,r)||C()}function y(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}function b(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function g(e,r){return(g=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function w(e){var r=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,n=F(e);if(r){var o=F(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return k(this,t)}}function k(e,r){return!r||"object"!==m(r)&&"function"!=typeof r?_(e):r}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(){E=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,r){["method","field"].forEach((function(t){r.forEach((function(r){r.kind===t&&"own"===r.placement&&this.defineClassElement(e,r)}),this)}),this)},initializeClassElements:function(e,r){var t=e.prototype;["method","field"].forEach((function(n){r.forEach((function(r){var o=r.placement;if(r.kind===n&&("static"===o||"prototype"===o)){var i="static"===o?e:t;this.defineClassElement(i,r)}}),this)}),this)},defineClassElement:function(e,r){var t=r.descriptor;if("field"===r.kind){var n=r.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,r.key,t)},decorateClass:function(e,r){var t=[],n=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!j(e))return t.push(e);var r=this.decorateElement(e,o);t.push(r.element),t.push.apply(t,r.extras),n.push.apply(n,r.finishers)}),this),!r)return{elements:t,finishers:n};var i=this.decorateConstructor(t,r);return n.push.apply(n,i.finishers),i.finishers=n,i},addElementPlacement:function(e,r,t){var n=r[e.placement];if(!t&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,r){for(var t=[],n=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=r[e.placement];a.splice(a.indexOf(e.key),1);var c=this.fromElementDescriptor(e),s=this.toElementFinisherExtras((0,o[i])(c)||c);e=s.element,this.addElementPlacement(e,r),s.finisher&&n.push(s.finisher);var l=s.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],r);t.push.apply(t,l)}}return{element:e,finishers:n,extras:t}},decorateConstructor:function(e,r){for(var t=[],n=r.length-1;n>=0;n--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,r[n])(o)||o);if(void 0!==i.finisher&&t.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var c=a+1;c<e.length;c++)if(e[a].key===e[c].key&&e[a].placement===e[c].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:t}},fromElementDescriptor:function(e){var r={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(r,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(r.initializer=e.initializer),r},toElementDescriptors:function(e){var r;if(void 0!==e)return(r=e,D(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||R(r)||C()).map((function(e){var r=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),r}),this)},toElementDescriptor:function(e){var r=String(e.kind);if("method"!==r&&"field"!==r)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+r+'"');var t=A(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)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 "'+n+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:r,key:t,placement:n,descriptor:Object.assign({},o)};return"field"!==r?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:z(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var r={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(r,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),r},toClassDescriptor:function(e){var r=String(e.kind);if("class"!==r)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+r+'"');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 t=z(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:t}},runClassFinishers:function(e,r){for(var t=0;t<r.length;t++){var n=(0,r[t])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,r,t){if(void 0!==e[r])throw new TypeError(t+" can't have a ."+r+" property.")}};return e}function S(e){var r,t=A(e.key);"method"===e.kind?r={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?r={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?r={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(r={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:t,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:r};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function P(e,r){void 0!==e.descriptor.get?r.descriptor.get=e.descriptor.get:r.descriptor.set=e.descriptor.set}function j(e){return e.decorators&&e.decorators.length}function O(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function z(e,r){var t=e[r];if(void 0!==t&&"function"!=typeof t)throw new TypeError("Expected '"+r+"' to be a function");return t}function A(e){var r=function(e,r){if("object"!==m(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!==m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===m(r)?r:String(r)}function C(){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 R(e,r){if(e){if("string"==typeof e)return T(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?T(e,r):void 0}}function T(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function D(e){if(Array.isArray(e))return e}function x(e,r,t){return(x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,r,t){var n=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=F(e)););return e}(e,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(t):o.value}})(e,r,t||e)}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var U={developer_states:{redirect:"/developer-tools/state"},developer_services:{redirect:"/developer-tools/service"},developer_call_service:{redirect:"/developer-tools/service",params:{service:"string"}},developer_template:{redirect:"/developer-tools/template"},developer_events:{redirect:"/developer-tools/event"},config:{redirect:"/config"},cloud:{component:"cloud",redirect:"/config/cloud"},integrations:{redirect:"/config/integrations"},config_flow_start:{redirect:"/config/integrations/add",params:{domain:"string"}},config_mqtt:{component:"mqtt",redirect:"/config/mqtt"},config_zha:{component:"zha",redirect:"/config/zha/dashboard"},config_zwave_js:{component:"zwave_js",redirect:"/config/zwave_js/dashboard"},devices:{redirect:"/config/devices/dashboard"},entities:{redirect:"/config/entities"},areas:{redirect:"/config/areas/dashboard"},blueprints:{component:"blueprint",redirect:"/config/blueprint/dashboard"},blueprint_import:{component:"blueprint",redirect:"/config/blueprint/dashboard/import",params:{blueprint_url:"url"}},automations:{component:"automation",redirect:"/config/automation/dashboard"},scenes:{component:"scene",redirect:"/config/scene/dashboard"},scripts:{component:"script",redirect:"/config/script/dashboard"},helpers:{redirect:"/config/helpers"},tags:{component:"tag",redirect:"/config/tags"},lovelace_dashboards:{component:"lovelace",redirect:"/config/lovelace/dashboards"},lovelace_resources:{component:"lovelace",redirect:"/config/lovelace/resources"},people:{component:"person",redirect:"/config/person"},zones:{component:"zone",redirect:"/config/zone"},users:{redirect:"/config/users"},general:{redirect:"/config/core"},server_controls:{redirect:"/config/server_control"},logs:{redirect:"/config/logs"},info:{redirect:"/config/info"},customize:{redirect:"/config/customize"},profile:{redirect:"/profile/dashboard"},logbook:{component:"logbook",redirect:"/logbook"},history:{component:"history",redirect:"/history"}};!function(e,r,t,n){var o=E();if(n)for(var i=0;i<n.length;i++)o=n[i](o);var a=r((function(e){o.initializeInstanceElements(e,c.elements)}),t),c=o.decorateClass(function(e){for(var r=[],t=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},n=0;n<e.length;n++){var o,i=e[n];if("method"===i.kind&&(o=r.find(t)))if(O(i.descriptor)||O(o.descriptor)){if(j(i)||j(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(j(i)){if(j(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}P(i,o)}else r.push(i)}return r}(a.d.map(S)),e);o.initializeClassElements(a.F,c.elements),o.runClassFinishers(a.F,c.finishers)}([(0,l.Mo)("ha-panel-my")],(function(e,r){var t=function(r){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&g(e,r)}(n,r);var t=w(n);function n(){var r;b(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),e(_(r)),r}return n}(r);return{F:t,d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"route",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_error",value:void 0},{kind:"method",key:"connectedCallback",value:function(){x(F(t.prototype),"connectedCallback",this).call(this);var e=this.route.path.substr(1);if(e.startsWith("supervisor"))return(0,u.p)(this.hass,"hassio")?void(0,f.c)("/hassio/_my_redirect/".concat(e).concat(window.location.search),{replace:!0}):void(this._error="no_supervisor");var r=U[e];if(r)if(!r.component||(0,u.p)(this.hass,r.component)){var n;try{n=this._createRedirectUrl(r)}catch(o){return void(this._error="url_error")}(0,f.c)(n,{replace:!0})}else this._error="no_component";else this._error="not_supported"}},{kind:"method",key:"render",value:function(){if(this._error){var e="Unknown error";switch(this._error){case"not_supported":e=this.hass.localize("ui.panel.my.not_supported","link",(0,s.dy)(n||(n=y(['<a\n target="_blank"\n rel="noreferrer noopener"\n href="https://my.home-assistant.io/faq.html#supported-pages"\n >',"</a\n >"])),this.hass.localize("ui.panel.my.faq_link")))||"This redirect is not supported.";break;case"no_component":e=this.hass.localize("ui.panel.my.component_not_loaded","integration",(0,p.Lh)(this.hass.localize,U[this.route.path.substr(1)].component))||"This redirect is not supported.";break;case"no_supervisor":e=this.hass.localize("ui.panel.my.no_supervisor","docs_link",(0,s.dy)(o||(o=y(['<a\n target="_blank"\n rel="noreferrer noopener"\n href="','"\n >',"</a\n >"])),(0,h.R)(this.hass,"/installation"),this.hass.localize("ui.panel.my.documentation")));break;default:e=this.hass.localize("ui.panel.my.error")||"Unknown error"}return(0,s.dy)(i||(i=y(["<hass-error-screen .error=","></hass-error-screen>"])),e)}return(0,s.dy)(a||(a=y([""])))}},{kind:"method",key:"_createRedirectUrl",value:function(e){var r=this._createRedirectParams(e);return"".concat(e.redirect).concat(r)}},{kind:"method",key:"_createRedirectParams",value:function(e){var r=this,t=(0,d.Q2)();if(!e.params&&!Object.keys(t).length)return"";var n={};return Object.entries(e.params||{}).forEach((function(e){var o=v(e,2),i=o[0],a=o[1];if(!t[i]||!r._checkParamType(a,t[i]))throw Error();n[i]=t[i]})),"?".concat((0,d.ou)(n))}},{kind:"method",key:"_checkParamType",value:function(e,r){return"string"===e||"url"===e&&(r&&r===(0,c.N)(r))}}]}}),s.oi)},27322:function(e,r,t){"use strict";t.d(r,{R:function(){return n}});var n=function(e,r){return"https://www.iobroker.net/#".concat(e.language&&e.language.split("-")[0]||"en","/adapters/adapterref/iobroker.lovelace/README.md")}}}]); //# sourceMappingURL=chunk.71b4d83a898c75437e82.js.map