iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 15.4 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9448],{69448:function(t,e,r){"use strict";var i,n,o,s=r(50424),a=r(55358),l=r(76666),c=r(56007),u=r(44817);r(10983);function p(t){return(p="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 f(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(t){var e=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(t){return!1}}();return function(){var r,i=C(t);if(e){var n=C(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return v(this,r)}}function v(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function b(){b=function(){return t};var t={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(t,e){["method","field"].forEach((function(r){e.forEach((function(e){e.kind===r&&"own"===e.placement&&this.defineClassElement(t,e)}),this)}),this)},initializeClassElements:function(t,e){var r=t.prototype;["method","field"].forEach((function(i){e.forEach((function(e){var n=e.placement;if(e.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?t:r;this.defineClassElement(o,e)}}),this)}),this)},defineClassElement:function(t,e){var r=e.descriptor;if("field"===e.kind){var i=e.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(t)}}Object.defineProperty(t,e.key,r)},decorateClass:function(t,e){var r=[],i=[],n={static:[],prototype:[],own:[]};if(t.forEach((function(t){this.addElementPlacement(t,n)}),this),t.forEach((function(t){if(!g(t))return r.push(t);var e=this.decorateElement(t,n);r.push(e.element),r.push.apply(r,e.extras),i.push.apply(i,e.finishers)}),this),!e)return{elements:r,finishers:i};var o=this.decorateConstructor(r,e);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(t,e,r){var i=e[t.placement];if(!r&&-1!==i.indexOf(t.key))throw new TypeError("Duplicated element ("+t.key+")");i.push(t.key)},decorateElement:function(t,e){for(var r=[],i=[],n=t.decorators,o=n.length-1;o>=0;o--){var s=e[t.placement];s.splice(s.indexOf(t.key),1);var a=this.fromElementDescriptor(t),l=this.toElementFinisherExtras((0,n[o])(a)||a);t=l.element,this.addElementPlacement(t,e),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var u=0;u<c.length;u++)this.addElementPlacement(c[u],e);r.push.apply(r,c)}}return{element:t,finishers:i,extras:r}},decorateConstructor:function(t,e){for(var r=[],i=e.length-1;i>=0;i--){var n=this.fromClassDescriptor(t),o=this.toClassDescriptor((0,e[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){t=o.elements;for(var s=0;s<t.length-1;s++)for(var a=s+1;a<t.length;a++)if(t[s].key===t[a].key&&t[s].placement===t[a].placement)throw new TypeError("Duplicated element ("+t[s].key+")")}}return{elements:t,finishers:r}},fromElementDescriptor:function(t){var e={kind:t.kind,key:t.key,placement:t.placement,descriptor:t.descriptor};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===t.kind&&(e.initializer=t.initializer),e},toElementDescriptors:function(t){var e;if(void 0!==t)return(e=t,function(t){if(Array.isArray(t))return t}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(e)||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(t){var e=this.toElementDescriptor(t);return this.disallowProperty(t,"finisher","An element descriptor"),this.disallowProperty(t,"extras","An element descriptor"),e}),this)},toElementDescriptor:function(t){var e=String(t.kind);if("method"!==e&&"field"!==e)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+e+'"');var r=j(t.key),i=String(t.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)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 "'+i+'"');var n=t.descriptor;this.disallowProperty(t,"elements","An element descriptor");var o={kind:e,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==e?this.disallowProperty(t,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=t.initializer),o},toElementFinisherExtras:function(t){return{element:this.toElementDescriptor(t),finisher:O(t,"finisher"),extras:this.toElementDescriptors(t.extras)}},fromClassDescriptor:function(t){var e={kind:"class",elements:t.map(this.fromElementDescriptor,this)};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),e},toClassDescriptor:function(t){var e=String(t.kind);if("class"!==e)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+e+'"');this.disallowProperty(t,"key","A class descriptor"),this.disallowProperty(t,"placement","A class descriptor"),this.disallowProperty(t,"descriptor","A class descriptor"),this.disallowProperty(t,"initializer","A class descriptor"),this.disallowProperty(t,"extras","A class descriptor");var r=O(t,"finisher");return{elements:this.toElementDescriptors(t.elements),finisher:r}},runClassFinishers:function(t,e){for(var r=0;r<e.length;r++){var i=(0,e[r])(t);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");t=i}}return t},disallowProperty:function(t,e,r){if(void 0!==t[e])throw new TypeError(r+" can't have a ."+e+" property.")}};return t}function k(t){var e,r=j(t.key);"method"===t.kind?e={value:t.value,writable:!0,configurable:!0,enumerable:!1}:"get"===t.kind?e={get:t.value,configurable:!0,enumerable:!1}:"set"===t.kind?e={set:t.value,configurable:!0,enumerable:!1}:"field"===t.kind&&(e={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===t.kind?"field":"method",key:r,placement:t.static?"static":"field"===t.kind?"own":"prototype",descriptor:e};return t.decorators&&(i.decorators=t.decorators),"field"===t.kind&&(i.initializer=t.value),i}function _(t,e){void 0!==t.descriptor.get?e.descriptor.get=t.descriptor.get:e.descriptor.set=t.descriptor.set}function g(t){return t.decorators&&t.decorators.length}function w(t){return void 0!==t&&!(void 0===t.value&&void 0===t.writable)}function O(t,e){var r=t[e];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+e+"' to be a function");return r}function j(t){var e=function(t,e){if("object"!==p(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!==p(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===p(e)?e:String(e)}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function E(t,e,r){return(E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=C(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(r):n.value}})(t,e,r||t)}function C(t){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}!function(t,e,r,i){var n=b();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=e((function(t){n.initializeInstanceElements(t,a.elements)}),r),a=n.decorateClass(function(t){for(var e=[],r=function(t){return"method"===t.kind&&t.key===o.key&&t.placement===o.placement},i=0;i<t.length;i++){var n,o=t[i];if("method"===o.kind&&(n=e.find(r)))if(w(o.descriptor)||w(n.descriptor)){if(g(o)||g(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(g(o)){if(g(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}_(o,n)}else e.push(o)}return e}(s.d.map(k)),t);n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,a.Mo)("ha-cover-tilt-controls")],(function(t,e){var r=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(i,e);var r=y(i);function i(){var e;d(this,i);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return e=r.call.apply(r,[this].concat(o)),t(m(e)),e}return i}(e);return{F:r,d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_entityObj",value:void 0},{kind:"method",key:"willUpdate",value:function(t){E(C(r.prototype),"willUpdate",this).call(this,t),t.has("stateObj")&&(this._entityObj=new u.ZP(this.hass,this.stateObj))}},{kind:"method",key:"render",value:function(){return this._entityObj?(0,s.dy)(n||(n=f([" <ha-icon-button\n class=","\n label=",'\n icon="hass:arrow-top-right"\n @click=',"\n .disabled=","\n ></ha-icon-button>\n <ha-icon-button\n class=","\n label=",'\n icon="hass:stop"\n @click=',"\n .disabled=","\n ></ha-icon-button>\n <ha-icon-button\n class=","\n label=",'\n icon="hass:arrow-bottom-left"\n @click=',"\n .disabled=","\n ></ha-icon-button>"])),(0,l.$)({invisible:!this._entityObj.supportsOpenTilt}),this.hass.localize("ui.dialogs.more_info_control.open_tilt_cover"),this._onOpenTiltTap,this._computeOpenDisabled(),(0,l.$)({invisible:!this._entityObj.supportsStopTilt}),this.hass.localize("ui.dialogs.more_info_control.stop_cover"),this._onStopTiltTap,this.stateObj.state===c.nZ,(0,l.$)({invisible:!this._entityObj.supportsCloseTilt}),this.hass.localize("ui.dialogs.more_info_control.close_tilt_cover"),this._onCloseTiltTap,this._computeClosedDisabled()):(0,s.dy)(i||(i=f([""])))}},{kind:"method",key:"_computeOpenDisabled",value:function(){if(this.stateObj.state===c.nZ)return!0;var t=!0===this.stateObj.attributes.assumed_state;return this._entityObj.isFullyOpenTilt&&!t}},{kind:"method",key:"_computeClosedDisabled",value:function(){if(this.stateObj.state===c.nZ)return!0;var t=!0===this.stateObj.attributes.assumed_state;return this._entityObj.isFullyClosedTilt&&!t}},{kind:"method",key:"_onOpenTiltTap",value:function(t){t.stopPropagation(),this._entityObj.openCoverTilt()}},{kind:"method",key:"_onCloseTiltTap",value:function(t){t.stopPropagation(),this._entityObj.closeCoverTilt()}},{kind:"method",key:"_onStopTiltTap",value:function(t){t.stopPropagation(),this._entityObj.stopCoverTilt()}},{kind:"get",static:!0,key:"styles",value:function(){return(0,s.iv)(o||(o=f(["\n :host {\n white-space: nowrap;\n }\n .invisible {\n visibility: hidden !important;\n }\n "])))}}]}}),s.oi)},44817:function(t,e,r){"use strict";r.d(e,{ZP:function(){return o},pu:function(){return s}});var i=r(40095);function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.hass=e,this.stateObj=r,this._attr=r.attributes,this._feat=this._attr.supported_features}var e,r,o;return e=t,(r=[{key:"isFullyOpen",get:function(){return void 0!==this._attr.current_position?100===this._attr.current_position:"open"===this.stateObj.state}},{key:"isFullyClosed",get:function(){return void 0!==this._attr.current_position?0===this._attr.current_position:"closed"===this.stateObj.state}},{key:"isFullyOpenTilt",get:function(){return 100===this._attr.current_tilt_position}},{key:"isFullyClosedTilt",get:function(){return 0===this._attr.current_tilt_position}},{key:"isOpening",get:function(){return"opening"===this.stateObj.state}},{key:"isClosing",get:function(){return"closing"===this.stateObj.state}},{key:"supportsOpen",get:function(){return(0,i.e)(this.stateObj,1)}},{key:"supportsClose",get:function(){return(0,i.e)(this.stateObj,2)}},{key:"supportsSetPosition",get:function(){return(0,i.e)(this.stateObj,4)}},{key:"supportsStop",get:function(){return(0,i.e)(this.stateObj,8)}},{key:"supportsOpenTilt",get:function(){return(0,i.e)(this.stateObj,16)}},{key:"supportsCloseTilt",get:function(){return(0,i.e)(this.stateObj,32)}},{key:"supportsStopTilt",get:function(){return(0,i.e)(this.stateObj,64)}},{key:"supportsSetTiltPosition",get:function(){return(0,i.e)(this.stateObj,128)}},{key:"isTiltOnly",get:function(){var t=this.supportsOpen||this.supportsClose||this.supportsStop;return(this.supportsOpenTilt||this.supportsCloseTilt||this.supportsStopTilt)&&!t}},{key:"openCover",value:function(){this.callService("open_cover")}},{key:"closeCover",value:function(){this.callService("close_cover")}},{key:"stopCover",value:function(){this.callService("stop_cover")}},{key:"openCoverTilt",value:function(){this.callService("open_cover_tilt")}},{key:"closeCoverTilt",value:function(){this.callService("close_cover_tilt")}},{key:"stopCoverTilt",value:function(){this.callService("stop_cover_tilt")}},{key:"setCoverPosition",value:function(t){this.callService("set_cover_position",{position:t})}},{key:"setCoverTiltPosition",value:function(t){this.callService("set_cover_tilt_position",{tilt_position:t})}},{key:"callService",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.entity_id=this.stateObj.entity_id,this.hass.callService("cover",t,e)}}])&&n(e.prototype,r),o&&n(e,o),t}();function s(t){var e=function(t){return(0,i.e)(t,1)}(t)||function(t){return(0,i.e)(t,2)}(t)||function(t){return(0,i.e)(t,8)}(t);return(function(t){return(0,i.e)(t,16)}(t)||function(t){return(0,i.e)(t,32)}(t)||function(t){return(0,i.e)(t,64)}(t))&&!e}}}]);
//# sourceMappingURL=chunk.ff268c4b8d6c35643537.js.map