iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 11.5 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[8912],{8544:function(t,e,n){"use strict";n(10983);var o=n(50856),i=n(28426),r=n(56007),s=n(44817);function u(t){return(u="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 c(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n <style>\n .state {\n white-space: nowrap;\n }\n [invisible] {\n visibility: hidden !important;\n }\n </style>\n\n <div class="state">\n <ha-icon-button\n aria-label="Open cover"\n icon="[[computeOpenIcon(stateObj)]]"\n on-click="onOpenTap"\n invisible$="[[!entityObj.supportsOpen]]"\n disabled="[[computeOpenDisabled(stateObj, entityObj)]]"\n ></ha-icon-button>\n <ha-icon-button\n aria-label="Stop the cover from moving"\n icon="hass:stop"\n on-click="onStopTap"\n invisible$="[[!entityObj.supportsStop]]"\n disabled="[[computeStopDisabled(stateObj)]]"\n ></ha-icon-button>\n <ha-icon-button\n aria-label="Close cover"\n icon="[[computeCloseIcon(stateObj)]]"\n on-click="onCloseTap"\n invisible$="[[!entityObj.supportsClose]]"\n disabled="[[computeClosedDisabled(stateObj, entityObj)]]"\n ></ha-icon-button>\n </div>\n ']);return c=function(){return t},t}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=y(t);if(e){var i=y(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return b(this,n)}}function b(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!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&&p(t,e)}(b,t);var e,n,i,u=f(b);function b(){return a(this,b),u.apply(this,arguments)}return e=b,i=[{key:"template",get:function(){return(0,o.d)(c())}},{key:"properties",get:function(){return{hass:{type:Object},stateObj:{type:Object},entityObj:{type:Object,computed:"computeEntityObj(hass, stateObj)"}}}}],(n=[{key:"computeEntityObj",value:function(t,e){return new s.ZP(t,e)}},{key:"computeOpenIcon",value:function(t){switch(t.attributes.device_class){case"awning":case"door":case"gate":return"hass:arrow-expand-horizontal";default:return"hass:arrow-up"}}},{key:"computeCloseIcon",value:function(t){switch(t.attributes.device_class){case"awning":case"door":case"gate":return"hass:arrow-collapse-horizontal";default:return"hass:arrow-down"}}},{key:"computeStopDisabled",value:function(t){return t.state===r.nZ}},{key:"computeOpenDisabled",value:function(t,e){if(t.state===r.nZ)return!0;var n=!0===t.attributes.assumed_state;return(e.isFullyOpen||e.isOpening)&&!n}},{key:"computeClosedDisabled",value:function(t,e){if(t.state===r.nZ)return!0;var n=!0===t.attributes.assumed_state;return(e.isFullyClosed||e.isClosing)&&!n}},{key:"onOpenTap",value:function(t){t.stopPropagation(),this.entityObj.openCover()}},{key:"onCloseTap",value:function(t){t.stopPropagation(),this.entityObj.closeCover()}},{key:"onStopTap",value:function(t){t.stopPropagation(),this.entityObj.stopCover()}}])&&l(e.prototype,n),i&&l(e,i),b}(i.H3);customElements.define("ha-cover-controls",v)},37466:function(t,e,n){"use strict";n(21157),n(10983);var o=n(50856),i=n(28426),r=n(56007),s=n(44817);function u(t){return(u="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 c(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n <style include="iron-flex"></style>\n <style>\n :host {\n white-space: nowrap;\n }\n [invisible] {\n visibility: hidden !important;\n }\n </style>\n <ha-icon-button\n aria-label="Open cover tilt"\n icon="hass:arrow-top-right"\n on-click="onOpenTiltTap"\n title="Open tilt"\n invisible$="[[!entityObj.supportsOpenTilt]]"\n disabled="[[computeOpenDisabled(stateObj, entityObj)]]"\n ></ha-icon-button>\n <ha-icon-button\n aria-label="Stop cover from moving"\n icon="hass:stop"\n on-click="onStopTiltTap"\n invisible$="[[!entityObj.supportsStopTilt]]"\n disabled="[[computeStopDisabled(stateObj)]]"\n title="Stop tilt"\n ></ha-icon-button>\n <ha-icon-button\n aria-label="Close cover tilt"\n icon="hass:arrow-bottom-left"\n on-click="onCloseTiltTap"\n title="Close tilt"\n invisible$="[[!entityObj.supportsCloseTilt]]"\n disabled="[[computeClosedDisabled(stateObj, entityObj)]]"\n ></ha-icon-button>\n ']);return c=function(){return t},t}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=y(t);if(e){var i=y(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return b(this,n)}}function b(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!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&&p(t,e)}(b,t);var e,n,i,u=f(b);function b(){return a(this,b),u.apply(this,arguments)}return e=b,i=[{key:"template",get:function(){return(0,o.d)(c())}},{key:"properties",get:function(){return{hass:{type:Object},stateObj:{type:Object},entityObj:{type:Object,computed:"computeEntityObj(hass, stateObj)"}}}}],(n=[{key:"computeEntityObj",value:function(t,e){return new s.ZP(t,e)}},{key:"computeStopDisabled",value:function(t){return t.state===r.nZ}},{key:"computeOpenDisabled",value:function(t,e){if(t.state===r.nZ)return!0;var n=!0===t.attributes.assumed_state;return e.isFullyOpenTilt&&!n}},{key:"computeClosedDisabled",value:function(t,e){if(t.state===r.nZ)return!0;var n=!0===t.attributes.assumed_state;return e.isFullyClosedTilt&&!n}},{key:"onOpenTiltTap",value:function(t){t.stopPropagation(),this.entityObj.openCoverTilt()}},{key:"onCloseTiltTap",value:function(t){t.stopPropagation(),this.entityObj.closeCoverTilt()}},{key:"onStopTiltTap",value:function(t){t.stopPropagation(),this.entityObj.stopCoverTilt()}}])&&l(e.prototype,n),i&&l(e,i),b}(i.H3);customElements.define("ha-cover-tilt-controls",v)},44817:function(t,e,n){"use strict";n.d(e,{ZP:function(){return r},pu:function(){return s}});var o=n(40095);function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var r=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.hass=e,this.stateObj=n,this._attr=n.attributes,this._feat=this._attr.supported_features}var e,n,r;return e=t,(n=[{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)}},{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,o.e)(this.stateObj,1)}},{key:"supportsClose",get:function(){return(0,o.e)(this.stateObj,2)}},{key:"supportsSetPosition",get:function(){return(0,o.e)(this.stateObj,4)}},{key:"supportsStop",get:function(){return(0,o.e)(this.stateObj,8)}},{key:"supportsOpenTilt",get:function(){return(0,o.e)(this.stateObj,16)}},{key:"supportsCloseTilt",get:function(){return(0,o.e)(this.stateObj,32)}},{key:"supportsStopTilt",get:function(){return(0,o.e)(this.stateObj,64)}},{key:"supportsSetTiltPosition",get:function(){return(0,o.e)(this.stateObj,128)}},{key:"isTiltOnly",get:function(){var t=this.supportsOpen||this.supportsClose||this.supportsStop;return(this.supportsOpenTilt||this.supportsCloseTilt||this.supportsStopTilt)&&!t}}])&&i(e.prototype,n),r&&i(e,r),t}();function s(t){var e=function(t){return(0,o.e)(t,1)}(t)||function(t){return(0,o.e)(t,2)}(t)||function(t){return(0,o.e)(t,8)}(t);return(function(t){return(0,o.e)(t,16)}(t)||function(t){return(0,o.e)(t,32)}(t)||function(t){return(0,o.e)(t,64)}(t))&&!e}}}]);
//# sourceMappingURL=chunk.c594ff45be670aa3643c.js.map