iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 16.5 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[722],{22383:function(e,t,r){"use strict";r.d(t,{$l:function(){return n},VZ:function(){return i},o5:function(){return o},z3:function(){return c},vn:function(){return a},go:function(){return s},mO:function(){return u},iJ:function(){return l},S_:function(){return f},lR:function(){return d},qm:function(){return p},bt:function(){return h},gg:function(){return m},yi:function(){return v},pT:function(){return y},dy:function(){return b},tz:function(){return g},Rp:function(){return w}});var n=function(e,t){return e.callWS({type:"zha/devices/reconfigure",ieee:t})},i=function(e,t,r,n,i){return e.callWS({type:"zha/devices/clusters/attributes",ieee:t,endpoint_id:r,cluster_id:n,cluster_type:i})},o=function(e,t){return e.callWS({type:"zha/device",ieee:t})},c=function(e,t){return e.callWS({type:"zha/devices/bindable",ieee:t})},a=function(e,t,r){return e.callWS({type:"zha/devices/bind",source_ieee:t,target_ieee:r})},s=function(e,t,r){return e.callWS({type:"zha/devices/unbind",source_ieee:t,target_ieee:r})},u=function(e,t,r,n){return e.callWS({type:"zha/groups/bind",source_ieee:t,group_id:r,bindings:n})},l=function(e,t,r,n){return e.callWS({type:"zha/groups/unbind",source_ieee:t,group_id:r,bindings:n})},f=function(e,t){return e.callWS(Object.assign({},t,{type:"zha/devices/clusters/attributes/value"}))},d=function(e,t,r,n,i){return e.callWS({type:"zha/devices/clusters/commands",ieee:t,endpoint_id:r,cluster_id:n,cluster_type:i})},p=function(e,t){return e.callWS({type:"zha/devices/clusters",ieee:t})},h=function(e){return e.callWS({type:"zha/groups"})},m=function(e,t){return e.callWS({type:"zha/group/remove",group_ids:t})},v=function(e,t){return e.callWS({type:"zha/group",group_id:t})},y=function(e){return e.callWS({type:"zha/devices/groupable"})},b=function(e,t,r){return e.callWS({type:"zha/group/members/add",group_id:t,members:r})},g=function(e,t,r){return e.callWS({type:"zha/group/members/remove",group_id:t,members:r})},w=function(e,t,r){return e.callWS({type:"zha/group/add",group_name:t,members:r})}},722:function(e,t,r){"use strict";r.r(t),r.d(t,{HaDeviceActionsZha:function(){return W}});var n=r(15652),i=r(11654),o=r(22383),c=r(83849),a=r(47181),s=function(){return Promise.all([r.e(5009),r.e(4358),r.e(6755),r.e(6372),r.e(9045),r.e(4821),r.e(3822),r.e(4909),r.e(7014)]).then(r.bind(r,2188))},u=r(26765),l=function(){return Promise.all([r.e(5009),r.e(4358),r.e(6755),r.e(6372),r.e(9045),r.e(4821),r.e(3822),r.e(4909),r.e(7014)]).then(r.bind(r,70935))};function f(e){return(f="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 d(){var e=w(["\n :host {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n "]);return d=function(){return e},e}function p(e,t,r,n,i,o,c){try{var a=e[o](c),s=a.value}catch(u){return void r(u)}a.done?t(s):Promise.resolve(s).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function c(e){p(o,n,i,c,a,"next",e)}function a(e){p(o,n,i,c,a,"throw",e)}c(void 0)}))}}function m(){var e=w(["\n <mwc-button @click=",">\n ","\n </mwc-button>\n <mwc-button @click=",">\n ",'\n </mwc-button>\n <mwc-button class="warning" @click=',">\n ","\n </mwc-button>\n "]);return m=function(){return e},e}function v(){var e=w(["\n <mwc-button @click=",">\n ","\n </mwc-button>\n "]);return v=function(){return e},e}function y(){var e=w(["\n <mwc-button @click=",">\n ","\n </mwc-button>\n "]);return y=function(){return e},e}function b(){var e=w(["\n ","\n ","\n ","\n "]);return b=function(){return e},e}function g(){var e=w([""]);return g=function(){return e},e}function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=S(e);if(t){var i=S(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return E(this,r)}}function E(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?D(e):t}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(){P=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!O(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var c=t[e.placement];c.splice(c.indexOf(e.key),1);var a=this.fromElementDescriptor(e),s=this.toElementFinisherExtras((0,i[o])(a)||a);e=s.element,this.addElementPlacement(e,t),s.finisher&&n.push(s.finisher);var u=s.extras;if(u){for(var l=0;l<u.length;l++)this.addElementPlacement(u[l],t);r.push.apply(r,u)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var c=0;c<e.length-1;c++)for(var a=c+1;a<e.length;a++)if(e[c].key===e[a].key&&e[c].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[c].key+")")}}return{elements:e,finishers:r}},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&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(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 r=j(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 i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,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 r=R(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function C(e){var t,r=j(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 n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function x(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function O(e){return e.decorators&&e.decorators.length}function A(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function R(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function j(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===f(t)?t:String(t)}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var W=function(e,t,r,n){var i=P();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var c=t((function(e){i.initializeInstanceElements(e,a.elements)}),r),a=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(A(o.descriptor)||A(i.descriptor)){if(O(o)||O(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(O(o)){if(O(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}x(o,i)}else t.push(o)}return t}(c.d.map(C)),e);return i.initializeClassElements(c.F,a.elements),i.runClassFinishers(c.F,a.finishers)}([(0,n.Mo)("ha-device-actions-zha")],(function(e,t){var r,f,p,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&&_(e,t)}(n,t);var r=z(n);function n(){var t;k(this,n);for(var i=arguments.length,o=new Array(i),c=0;c<i;c++)o[c]=arguments[c];return t=r.call.apply(r,[this].concat(o)),e(D(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"device",value:void 0},{kind:"field",decorators:[(0,n.sz)()],key:"_zhaDevice",value:void 0},{kind:"method",key:"updated",value:function(e){var t=this;if(e.has("device")){var r=this.device.connections.find((function(e){return"zigbee"===e[0]}));if(!r)return;(0,o.o5)(this.hass,r[1]).then((function(e){t._zhaDevice=e}))}}},{kind:"method",key:"render",value:function(){return this._zhaDevice?(0,n.dy)(b(),"Coordinator"!==this._zhaDevice.device_type?(0,n.dy)(y(),this._onReconfigureNodeClick,this.hass.localize("ui.dialogs.zha_device_info.buttons.reconfigure")):"","Mains"!==this._zhaDevice.power_source||"Router"!==this._zhaDevice.device_type&&"Coordinator"!==this._zhaDevice.device_type?"":(0,n.dy)(v(),this._onAddDevicesClick,this.hass.localize("ui.dialogs.zha_device_info.buttons.add")),"Coordinator"!==this._zhaDevice.device_type?(0,n.dy)(m(),this._handleZigbeeInfoClicked,this.hass.localize("ui.dialogs.zha_device_info.buttons.zigbee_information"),this._showClustersDialog,this.hass.localize("ui.dialogs.zha_device_info.buttons.clusters"),this._removeDevice,this.hass.localize("ui.dialogs.zha_device_info.buttons.remove")):""):(0,n.dy)(g())}},{kind:"method",key:"_showClustersDialog",value:(w=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t=this,r={device:this._zhaDevice},void(0,a.B)(t,"show-dialog",{dialogTag:"dialog-zha-cluster",dialogImport:l,dialogParams:r});case 2:case"end":return e.stop()}var t,r}),e,this)}))),function(){return w.apply(this,arguments)})},{kind:"method",key:"_onReconfigureNodeClick",value:(p=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hass){e.next=2;break}return e.abrupt("return");case 2:(0,o.$l)(this.hass,this._zhaDevice.ieee);case 3:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{kind:"method",key:"_onAddDevicesClick",value:function(){(0,c.c)(this,"/config/zha/add/"+this._zhaDevice.ieee)}},{kind:"method",key:"_handleZigbeeInfoClicked",value:(f=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this,r={device:this._zhaDevice},(0,a.B)(t,"show-dialog",{dialogTag:"dialog-zha-device-zigbee-info",dialogImport:s,dialogParams:r});case 1:case"end":return e.stop()}var t,r}),e,this)}))),function(){return f.apply(this,arguments)})},{kind:"method",key:"_removeDevice",value:(r=h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,u.g7)(this,{text:this.hass.localize("ui.dialogs.zha_device_info.confirmations.remove")});case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,this.hass.callService("zha","remove",{ieee:this._zhaDevice.ieee});case 7:history.back();case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[i.Qx,(0,n.iv)(d())]}}]}}),n.oi)}}]);
//# sourceMappingURL=chunk.586c9b572788527093c8.js.map