UNPKG

iobroker.lovelace

Version:

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

2 lines 16.6 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[8914],{8914:function(t,e,n){"use strict";n.r(e);n(52039);var r=n(15652),i=n(94707),o=n(75692),s=n(55317);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 c(){var t=E(["\n ha-svg-icon {\n color: var(--paper-item-icon-color);\n }\n .section {\n margin: 16px 0 8px 0;\n font-size: 1.2em;\n }\n\n .flex {\n display: flex;\n height: 32px;\n align-items: center;\n }\n\n .main {\n flex: 1;\n margin-left: 24px;\n }\n\n .temp,\n .templow {\n min-width: 48px;\n text-align: right;\n }\n\n .templow {\n margin: 0 16px;\n color: var(--secondary-text-color);\n }\n\n .attribution {\n color: var(--secondary-text-color);\n text-align: center;\n }\n "]);return c=function(){return t},t}function l(){var t=E(['\n <div class="attribution">\n ',"\n </div>\n "]);return l=function(){return t},t}function u(){var t=E(['\n <div class="main">\n ','\n </div>\n <div class="templow">\n ',"\n ","\n </div>\n "]);return u=function(){return t},t}function d(){var t=E(['\n <div class="main">\n ',"\n </div>\n "]);return d=function(){return t},t}function f(){var t=E(['\n <ha-svg-icon\n .path="','"\n ></ha-svg-icon>\n ']);return f=function(){return t},t}function h(){var t=E(['\n <div\n class="icon-image"\n style="min-width: 32px; min-height: 32px;"\n >\n ',"\n </div>\n "]);return h=function(){return t},t}function p(){var t=E(['\n <div class="flex">\n \x3c!-- // IoB weather icon from URL - change below in ha-svg-icon is IoB, too. --\x3e\n ',"\n ","\n ",'\n <div class="temp">\n ',"\n ","\n </div>\n </div>\n "]);return p=function(){return t},t}function m(){var t=E(['\n <div class="section">\n ',":\n </div>\n ","\n "]);return m=function(){return t},t}function v(){var t=E(['\n <div class="flex">\n <ha-svg-icon .path=','></ha-svg-icon>\n <div class="main">\n ',"\n </div>\n <div>\n ","\n ","\n </div>\n </div>\n "]);return v=function(){return t},t}function y(){var t=E(['\n <div class="flex">\n <ha-svg-icon .path=','></ha-svg-icon>\n <div class="main">\n ',"\n </div>\n <div>\n ","\n </div>\n </div>\n "]);return y=function(){return t},t}function b(){var t=E(['\n <div class="flex">\n <ha-svg-icon .path=','></ha-svg-icon>\n <div class="main">\n ',"\n </div>\n <div>"," %</div>\n </div>\n "]);return b=function(){return t},t}function w(){var t=E(['\n <div class="flex">\n <ha-svg-icon .path=','></ha-svg-icon>\n <div class="main">\n ',"\n </div>\n <div>\n ","\n ","\n </div>\n </div>\n "]);return w=function(){return t},t}function g(){var t=E(['\n <div class="flex">\n <ha-svg-icon .path=','></ha-svg-icon>\n <div class="main">\n ',"\n </div>\n <div>\n ","\n ","\n </div>\n </div>\n ","\n ","\n ","\n ","\n ","\n ","\n "]);return g=function(){return t},t}function k(){var t=E([""]);return k=function(){return t},t}function E(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){return(x=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function j(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=P(t);if(e){var i=P(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return D(this,n)}}function D(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?_(t):e}function _(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P(t){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function S(){S=function(){return t};var t={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(t,e){["method","field"].forEach((function(n){e.forEach((function(e){e.kind===n&&"own"===e.placement&&this.defineClassElement(t,e)}),this)}),this)},initializeClassElements:function(t,e){var n=t.prototype;["method","field"].forEach((function(r){e.forEach((function(e){var i=e.placement;if(e.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?t:n;this.defineClassElement(o,e)}}),this)}),this)},defineClassElement:function(t,e){var n=e.descriptor;if("field"===e.kind){var r=e.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(t)}}Object.defineProperty(t,e.key,n)},decorateClass:function(t,e){var n=[],r=[],i={static:[],prototype:[],own:[]};if(t.forEach((function(t){this.addElementPlacement(t,i)}),this),t.forEach((function(t){if(!A(t))return n.push(t);var e=this.decorateElement(t,i);n.push(e.element),n.push.apply(n,e.extras),r.push.apply(r,e.finishers)}),this),!e)return{elements:n,finishers:r};var o=this.decorateConstructor(n,e);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(t,e,n){var r=e[t.placement];if(!n&&-1!==r.indexOf(t.key))throw new TypeError("Duplicated element ("+t.key+")");r.push(t.key)},decorateElement:function(t,e){for(var n=[],r=[],i=t.decorators,o=i.length-1;o>=0;o--){var s=e[t.placement];s.splice(s.indexOf(t.key),1);var a=this.fromElementDescriptor(t),c=this.toElementFinisherExtras((0,i[o])(a)||a);t=c.element,this.addElementPlacement(t,e),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],e);n.push.apply(n,l)}}return{element:t,finishers:r,extras:n}},decorateConstructor:function(t,e){for(var n=[],r=e.length-1;r>=0;r--){var i=this.fromClassDescriptor(t),o=this.toClassDescriptor((0,e[r])(i)||i);if(void 0!==o.finisher&&n.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:n}},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&&Symbol.iterator in Object(t))return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(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 n=I(t.key),r=String(t.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)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 "'+r+'"');var i=t.descriptor;this.disallowProperty(t,"elements","An element descriptor");var o={kind:e,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==e?this.disallowProperty(t,"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=t.initializer),o},toElementFinisherExtras:function(t){return{element:this.toElementDescriptor(t),finisher:F(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 n=F(t,"finisher");return{elements:this.toElementDescriptors(t.elements),finisher:n}},runClassFinishers:function(t,e){for(var n=0;n<e.length;n++){var r=(0,e[n])(t);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");t=r}}return t},disallowProperty:function(t,e,n){if(void 0!==t[e])throw new TypeError(n+" can't have a ."+e+" property.")}};return t}function C(t){var e,n=I(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 r={kind:"field"===t.kind?"field":"method",key:n,placement:t.static?"static":"field"===t.kind?"own":"prototype",descriptor:e};return t.decorators&&(r.decorators=t.decorators),"field"===t.kind&&(r.initializer=t.value),r}function z(t,e){void 0!==t.descriptor.get?e.descriptor.get=t.descriptor.get:e.descriptor.set=t.descriptor.set}function A(t){return t.decorators&&t.decorators.length}function T(t){return void 0!==t&&!(void 0===t.value&&void 0===t.writable)}function F(t,e){var n=t[e];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+e+"' to be a function");return n}function I(t){var e=function(t,e){if("object"!==a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===a(e)?e:String(e)}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var V={"clear-night":s.j0g,cloudy:s.Ih7,exceptional:s._gM,fog:s.VE8,hail:s.h6G,lightning:s.cjw,"lightning-rainy":s.sIW,partlycloudy:s.PKD,pouring:s.NQM,rainy:s.yxk,snowy:s.I0_,"snowy-rainy":s.kRf,sunny:s.bFF,windy:s.GOG,"windy-variant":s.l_3};!function(t,e,n,r){var i=S();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var s=e((function(t){i.initializeInstanceElements(t,a.elements)}),n),a=i.decorateClass(function(t){for(var e=[],n=function(t){return"method"===t.kind&&t.key===o.key&&t.placement===o.placement},r=0;r<t.length;r++){var i,o=t[r];if("method"===o.kind&&(i=e.find(n)))if(T(o.descriptor)||T(i.descriptor)){if(A(o)||A(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(A(o)){if(A(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}z(o,i)}else e.push(o)}return e}(s.d.map(C)),t);i.initializeClassElements(s.F,a.elements),i.runClassFinishers(s.F,a.finishers)}([(0,r.Mo)("more-info-weather")],(function(t,e){return{F: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&&x(t,e)}(r,e);var n=j(r);function r(){var e;O(this,r);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return e=n.call.apply(n,[this].concat(o)),t(_(e)),e}return r}(e),d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"stateObj",value:void 0},{kind:"method",key:"shouldUpdate",value:function(t){if(t.has("stateObj"))return!0;var e=t.get("hass");return!e||e.language!==this.hass.language||e.config.unit_system!==this.hass.config.unit_system}},{kind:"method",key:"render",value:function(){var t=this;if(!this.hass||!this.stateObj)return(0,i.dy)(k());var e=(0,o.M0)(this.stateObj.state);return(0,i.dy)(g(),s.Qfy,this.hass.localize("ui.card.weather.attributes.temperature"),this.stateObj.attributes.temperature,(0,o.pv)(this.hass,"temperature"),this._showValue(this.stateObj.attributes.pressure)?(0,i.dy)(w(),s.mXo,this.hass.localize("ui.card.weather.attributes.air_pressure"),this.stateObj.attributes.pressure,(0,o.pv)(this.hass,"air_pressure")):"",this._showValue(this.stateObj.attributes.humidity)?(0,i.dy)(b(),s.uUi,this.hass.localize("ui.card.weather.attributes.humidity"),this.stateObj.attributes.humidity):"",this._showValue(this.stateObj.attributes.wind_speed)?(0,i.dy)(y(),s.GOG,this.hass.localize("ui.card.weather.attributes.wind_speed"),(0,o.NF)(this.hass,this.stateObj.attributes.wind_speed,this.stateObj.attributes.wind_bearing)):"",this._showValue(this.stateObj.attributes.visibility)?(0,i.dy)(v(),s.rgx,this.hass.localize("ui.card.weather.attributes.visibility"),this.stateObj.attributes.visibility,(0,o.pv)(this.hass,"length")):"",this.stateObj.attributes.forecast?(0,i.dy)(m(),this.hass.localize("ui.card.weather.forecast"),this.stateObj.attributes.forecast.map((function(n){return(0,i.dy)(p(),n.condition?e?(0,i.dy)(h(),(0,o.Cq)(n.condition,t,!1,t.hass.auth.accessToken)):(0,i.dy)(f(),V[n.condition]):"",t._showValue(n.templow)?"":(0,i.dy)(d(),t.computeDateTime(n.datetime)),t._showValue(n.templow)?(0,i.dy)(u(),t.computeDate(n.datetime),n.templow,(0,o.pv)(t.hass,"temperature")):"",n.temperature,(0,o.pv)(t.hass,"temperature"))}))):"",this.stateObj.attributes.attribution?(0,i.dy)(l(),this.stateObj.attributes.attribution):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(c())}},{kind:"method",key:"computeDate",value:function(t){return new Date(t).toLocaleDateString(this.hass.language,{weekday:"long",month:"short",day:"numeric"})}},{kind:"method",key:"computeDateTime",value:function(t){return new Date(t).toLocaleDateString(this.hass.language,{weekday:"long",hour:"numeric"})}},{kind:"method",key:"_showValue",value:function(t){return null!=t}}]}}),r.oi)}}]); //# sourceMappingURL=chunk.cbae41afab6c6ff2164b.js.map