iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 10.7 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9626],{24381:function(t,e,n){"use strict";n.d(e,{Q:function(){return r}});var r=function(t,e){return t?e.map((function(e){return e in t.attributes?"has-"+e:""})).filter((function(t){return""!==t})).join(" "):""}},81303:function(t,e,n){"use strict";n(8878);function r(t){return(r="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 o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(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,r=l(t);if(e){var o=l(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}function s(t,e){return!e||"object"!==r(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 l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=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&&a(t,e)}(f,t);var e,n,r,s=u(f);function f(){return o(this,f),s.apply(this,arguments)}return e=f,(n=[{key:"ready",value:function(){var t=this;c(l(f.prototype),"ready",this).call(this),setTimeout((function(){"rtl"===window.getComputedStyle(t).direction&&(t.style.textAlign="right")}),100)}}])&&i(e.prototype,n),r&&i(e,r),f}(customElements.get("paper-dropdown-menu"));customElements.define("ha-paper-dropdown-menu",f)},69626:function(t,e,n){"use strict";n.r(e);n(21157),n(10983),n(53973),n(51095);var r=n(50856),o=n(28426),i=n(24381),c=(n(31811),n(81303),n(43709),n(11052));function a(t){return(a="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 u(){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 .container-speed_list,\n .container-direction,\n .container-oscillating {\n display: none;\n }\n\n .has-speed_list .container-speed_list,\n .has-direction .container-direction,\n .has-oscillating .container-oscillating {\n display: block;\n }\n\n ha-paper-dropdown-menu {\n width: 100%;\n }\n\n paper-item {\n cursor: pointer;\n }\n </style>\n\n <div class$="[[computeClassNames(stateObj)]]">\n <div class="container-speed_list">\n <ha-paper-dropdown-menu\n label-float=""\n dynamic-align=""\n label="[[localize(\'ui.card.fan.speed\')]]"\n >\n <paper-listbox\n slot="dropdown-content"\n selected="[[stateObj.attributes.speed]]"\n on-selected-changed="speedChanged"\n attr-for-selected="item-name"\n >\n <template\n is="dom-repeat"\n items="[[stateObj.attributes.speed_list]]"\n >\n <paper-item item-name$="[[item]]">[[item]]</paper-item>\n </template>\n </paper-listbox>\n </ha-paper-dropdown-menu>\n </div>\n\n <div class="container-oscillating">\n <div class="center horizontal layout single-row">\n <div class="flex">[[localize(\'ui.card.fan.oscillate\')]]</div>\n <ha-switch\n checked="[[oscillationToggleChecked]]"\n on-change="oscillationToggleChanged"\n >\n </ha-switch>\n </div>\n </div>\n\n <div class="container-direction">\n <div class="direction">\n <div>[[localize(\'ui.card.fan.direction\')]]</div>\n <ha-icon-button\n icon="hass:rotate-left"\n on-click="onDirectionReverse"\n title="[[localize(\'ui.card.fan.reverse\')]]"\n disabled="[[computeIsRotatingReverse(stateObj)]]"\n ></ha-icon-button>\n <ha-icon-button\n icon="hass:rotate-right"\n on-click="onDirectionForward"\n title="[[localize(\'ui.card.fan.forward\')]]"\n disabled="[[computeIsRotatingForward(stateObj)]]"\n ></ha-icon-button>\n </div>\n </div>\n </div>\n\n <ha-attributes\n state-obj="[[stateObj]]"\n extra-filters="speed,speed_list,oscillating,direction"\n ></ha-attributes>\n ']);return u=function(){return t},t}function s(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 r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(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,r=d(t);if(e){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}function y(t,e){return!e||"object"!==a(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 d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var b=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&&f(t,e)}(a,t);var e,n,o,c=p(a);function a(){return s(this,a),c.apply(this,arguments)}return e=a,o=[{key:"template",get:function(){return(0,r.d)(u())}},{key:"properties",get:function(){return{hass:{type:Object},stateObj:{type:Object,observer:"stateObjChanged"},oscillationToggleChecked:{type:Boolean}}}}],(n=[{key:"stateObjChanged",value:function(t,e){var n=this;t&&this.setProperties({oscillationToggleChecked:t.attributes.oscillating}),e&&setTimeout((function(){n.fire("iron-resize")}),500)}},{key:"computeClassNames",value:function(t){return"more-info-fan "+(0,i.Q)(t,["oscillating","speed_list","direction"])}},{key:"speedChanged",value:function(t){var e=this.stateObj.attributes.speed,n=t.detail.value;n&&e!==n&&this.hass.callService("fan","turn_on",{entity_id:this.stateObj.entity_id,speed:n})}},{key:"oscillationToggleChanged",value:function(t){var e=this.stateObj.attributes.oscillating,n=t.target.checked;e!==n&&this.hass.callService("fan","oscillate",{entity_id:this.stateObj.entity_id,oscillating:n})}},{key:"onDirectionReverse",value:function(){this.hass.callService("fan","set_direction",{entity_id:this.stateObj.entity_id,direction:"reverse"})}},{key:"onDirectionForward",value:function(){this.hass.callService("fan","set_direction",{entity_id:this.stateObj.entity_id,direction:"forward"})}},{key:"computeIsRotatingReverse",value:function(t){return"reverse"===t.attributes.direction}},{key:"computeIsRotatingForward",value:function(t){return"forward"===t.attributes.direction}}])&&l(e.prototype,n),o&&l(e,o),a}((0,n(1265).Z)((0,c.I)(o.H3)));customElements.define("more-info-fan",b)},11052:function(t,e,n){"use strict";n.d(e,{I:function(){return p}});var r=n(76389),o=n(47181);function i(t){return(i="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(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(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,r=f(t);if(e){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}function l(t,e){return!e||"object"!==i(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 f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=(0,r.o)((function(t){return 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&&u(t,e)}(l,t);var e,n,r,i=s(l);function l(){return c(this,l),i.apply(this,arguments)}return e=l,(n=[{key:"fire",value:function(t,e,n){return n=n||{},(0,o.B)(n.node||this,t,e,n)}}])&&a(e.prototype,n),r&&a(e,r),l}(t)}))}}]);
//# sourceMappingURL=chunk.bd9e1a45b39bca948edb.js.map