iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 24 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[1927],{49706:function(e,t,r){"use strict";r.d(t,{Rb:function(){return a},Zy:function(){return n},h2:function(){return o},PS:function(){return i},l:function(){return s},ht:function(){return c},f0:function(){return l},tj:function(){return u},uo:function(){return d},lC:function(){return h},Kk:function(){return f},ot:function(){return p},gD:function(){return m},a1:function(){return b},AZ:function(){return v}});var a="hass:bookmark",n={alert:"hass:alert",alexa:"hass:amazon-alexa",air_quality:"hass:air-filter",automation:"hass:robot",calendar:"hass:calendar",camera:"hass:video",climate:"hass:thermostat",configurator:"hass:cog",conversation:"hass:text-to-speech",counter:"hass:counter",device_tracker:"hass:account",fan:"hass:fan",google_assistant:"hass:google-assistant",group:"hass:google-circles-communities",homeassistant:"hass:home-assistant",homekit:"hass:home-automation",image_processing:"hass:image-filter-frames",input_boolean:"hass:toggle-switch-outline",input_datetime:"hass:calendar-clock",input_number:"hass:ray-vertex",input_select:"hass:format-list-bulleted",input_text:"hass:form-textbox",light:"hass:lightbulb",mailbox:"hass:mailbox",notify:"hass:comment-alert",persistent_notification:"hass:bell",person:"hass:account",plant:"hass:flower",proximity:"hass:apple-safari",remote:"hass:remote",scene:"hass:palette",script:"hass:script-text",sensor:"hass:eye",simple_alarm:"hass:bell",sun:"hass:white-balance-sunny",switch:"hass:flash",timer:"hass:timer-outline",updater:"hass:cloud-upload",vacuum:"hass:robot-vacuum",water_heater:"hass:thermometer",weather:"hass:weather-cloudy",zone:"hass:map-marker-radius"},o={current:"hass:current-ac",energy:"hass:flash",humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",power_factor:"hass:angle-acute",signal_strength:"hass:wifi",timestamp:"hass:clock",voltage:"hass:sine-wave"},i=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater"],s=["alarm_control_panel","automation","camera","climate","configurator","counter","cover","fan","group","humidifier","input_datetime","light","lock","media_player","person","script","sun","timer","vacuum","water_heater","weather"],c=["input_number","input_select","input_text","scene"],l=["camera","configurator","scene"],u=["closed","locked","off"],d="on",h="off",f=new Set(["fan","input_boolean","light","switch","group","automation","humidifier"]),p="°C",m="°F",b="group.default_view",v=["ff0029","66a61e","377eb8","984ea3","00d2d5","ff7f00","af8d00","7f80cd","b3e900","c42e60","a65628","f781bf","8dd3c7","bebada","fb8072","80b1d3","fdb462","fccde5","bc80bd","ffed6f","c4eaff","cf8c00","1b9e77","d95f02","e7298a","e6ab02","a6761d","0097ff","00d067","f43600","4ba93b","5779bb","927acc","97ee3f","bf3947","9f5b00","f48758","8caed6","f2b94f","eff26e","e43872","d9b100","9d7a00","698cff","d9d9d9","00d27e","d06800","009f82","c49200","cbe8ff","fecddf","c27eb6","8cd2ce","c4b8d9","f883b0","a49100","f48800","27d0df","a04a9b"]},44634:function(e,t,r){"use strict";r.d(t,{M:function(){return a}});var a=function(e,t){var r=Number(e.state),a=t&&"on"===t.state;if(isNaN(r))return"hass:battery-unknown";var n="hass:battery",o=10*Math.round(r/10);return a&&r>10?n+="-charging-".concat(o):a?n+="-outline":r<=5?n+="-alert":r>5&&r<95&&(n+="-".concat(o)),n}},56949:function(e,t,r){"use strict";r.d(t,{q:function(){return a}});var a=function(e){var t=e.entity_id.split(".")[0],r=e.state;return"climate"===t&&(r=e.attributes.hvac_action),r}},27269:function(e,t,r){"use strict";r.d(t,{p:function(){return a}});var a=function(e){return e.substr(e.indexOf(".")+1)}},91741:function(e,t,r){"use strict";r.d(t,{C:function(){return n}});var a=r(27269),n=function(e){return void 0===e.attributes.friendly_name?(0,a.p)(e.entity_id).replace(/_/g," "):e.attributes.friendly_name||""}},76151:function(e,t,r){"use strict";r.d(t,{K:function(){return o}});var a=r(49706),n=r(44634),o=function(e,t,r){var o=void 0!==r?r:null==t?void 0:t.state;switch(e){case"alarm_control_panel":switch(o){case"armed_home":return"hass:bell-plus";case"armed_night":return"hass:bell-sleep";case"disarmed":return"hass:bell-outline";case"triggered":return"hass:bell-ring";default:return"hass:bell"}case"binary_sensor":return function(e,t){var r="off"===e;switch(null==t?void 0:t.attributes.device_class){case"battery":return r?"hass:battery":"hass:battery-outline";case"battery_charging":return r?"hass:battery":"hass:battery-charging";case"cold":return r?"hass:thermometer":"hass:snowflake";case"connectivity":return r?"hass:server-network-off":"hass:server-network";case"door":return r?"hass:door-closed":"hass:door-open";case"garage_door":return r?"hass:garage":"hass:garage-open";case"power":return r?"hass:power-plug-off":"hass:power-plug";case"gas":case"problem":case"safety":case"smoke":return r?"hass:check-circle":"hass:alert-circle";case"heat":return r?"hass:thermometer":"hass:fire";case"light":return r?"hass:brightness-5":"hass:brightness-7";case"lock":return r?"hass:lock":"hass:lock-open";case"moisture":return r?"hass:water-off":"hass:water";case"motion":return r?"hass:walk":"hass:run";case"occupancy":return r?"hass:home-outline":"hass:home";case"opening":return r?"hass:square":"hass:square-outline";case"plug":return r?"hass:power-plug-off":"hass:power-plug";case"presence":return r?"hass:home-outline":"hass:home";case"sound":return r?"hass:music-note-off":"hass:music-note";case"vibration":return r?"hass:crop-portrait":"hass:vibrate";case"window":return r?"hass:window-closed":"hass:window-open";default:return r?"hass:radiobox-blank":"hass:checkbox-marked-circle"}}(o,t);case"cover":return function(e,t){var r="closed"!==e;switch(null==t?void 0:t.attributes.device_class){case"garage":switch(e){case"opening":return"hass:arrow-up-box";case"closing":return"hass:arrow-down-box";case"closed":return"hass:garage";default:return"hass:garage-open"}case"gate":switch(e){case"opening":case"closing":return"hass:gate-arrow-right";case"closed":return"hass:gate";default:return"hass:gate-open"}case"door":return r?"hass:door-open":"hass:door-closed";case"damper":return r?"hass:circle":"hass:circle-slice-8";case"shutter":switch(e){case"opening":return"hass:arrow-up-box";case"closing":return"hass:arrow-down-box";case"closed":return"hass:window-shutter";default:return"hass:window-shutter-open"}case"blind":case"curtain":switch(e){case"opening":return"hass:arrow-up-box";case"closing":return"hass:arrow-down-box";case"closed":return"hass:blinds";default:return"hass:blinds-open"}case"window":switch(e){case"opening":return"hass:arrow-up-box";case"closing":return"hass:arrow-down-box";case"closed":return"hass:window-closed";default:return"hass:window-open"}}switch(e){case"opening":return"hass:arrow-up-box";case"closing":return"hass:arrow-down-box";case"closed":return"hass:window-closed";default:return"hass:window-open"}}(o,t);case"humidifier":return r&&"off"===r?"hass:air-humidifier-off":"hass:air-humidifier";case"lock":return"unlocked"===o?"hass:lock-open":"hass:lock";case"media_player":return"playing"===o?"hass:cast-connected":"hass:cast";case"zwave":switch(o){case"dead":return"hass:emoticon-dead";case"sleeping":return"hass:sleep";case"initializing":return"hass:timer-sand";default:return"hass:z-wave"}case"sensor":var i=function(e){var t=null==e?void 0:e.attributes.device_class;if(t&&t in a.h2)return a.h2[t];if("battery"===t)return e?(0,n.M)(e):"hass:battery";var r=null==e?void 0:e.attributes.unit_of_measurement;return r===a.ot||r===a.gD?"hass:thermometer":void 0}(t);if(i)return i;break;case"input_datetime":if(!(null==t?void 0:t.attributes.has_date))return"hass:clock";if(!t.attributes.has_time)return"hass:calendar"}return e in a.Zy?a.Zy[e]:(console.warn("Unable to find icon for domain "+e+" ("+t+")"),a.Rb)}},36145:function(e,t,r){"use strict";r.d(t,{M:function(){return i}});var a=r(49706),n=r(58831),o=r(76151),i=function(e){return e?e.attributes.icon?e.attributes.icon:(0,o.K)((0,n.M)(e.entity_id),e):a.Rb}},52797:function(e,t,r){"use strict";function a(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n ha-icon[data-domain="alert"][data-state="on"],\n ha-icon[data-domain="automation"][data-state="on"],\n ha-icon[data-domain="binary_sensor"][data-state="on"],\n ha-icon[data-domain="calendar"][data-state="on"],\n ha-icon[data-domain="camera"][data-state="streaming"],\n ha-icon[data-domain="cover"][data-state="open"],\n ha-icon[data-domain="fan"][data-state="on"],\n ha-icon[data-domain="humidifier"][data-state="on"],\n ha-icon[data-domain="light"][data-state="on"],\n ha-icon[data-domain="input_boolean"][data-state="on"],\n ha-icon[data-domain="lock"][data-state="unlocked"],\n ha-icon[data-domain="media_player"][data-state="on"],\n ha-icon[data-domain="media_player"][data-state="paused"],\n ha-icon[data-domain="media_player"][data-state="playing"],\n ha-icon[data-domain="script"][data-state="running"],\n ha-icon[data-domain="sun"][data-state="above_horizon"],\n ha-icon[data-domain="switch"][data-state="on"],\n ha-icon[data-domain="timer"][data-state="active"],\n ha-icon[data-domain="vacuum"][data-state="cleaning"],\n ha-icon[data-domain="group"][data-state="on"],\n ha-icon[data-domain="group"][data-state="home"],\n ha-icon[data-domain="group"][data-state="open"],\n ha-icon[data-domain="group"][data-state="locked"],\n ha-icon[data-domain="group"][data-state="problem"] {\n color: var(--paper-item-icon-active-color, #fdd835);\n }\n\n ha-icon[data-domain="climate"][data-state="cooling"] {\n color: var(--cool-color, #2b9af9);\n }\n\n ha-icon[data-domain="climate"][data-state="heating"] {\n color: var(--heat-color, #ff8100);\n }\n\n ha-icon[data-domain="climate"][data-state="drying"] {\n color: var(--dry-color, #efbd07);\n }\n\n ha-icon[data-domain="alarm_control_panel"] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n }\n\n ha-icon[data-domain="alarm_control_panel"][data-state="disarmed"] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n }\n\n ha-icon[data-domain="alarm_control_panel"][data-state="pending"],\n ha-icon[data-domain="alarm_control_panel"][data-state="arming"] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n }\n\n ha-icon[data-domain="alarm_control_panel"][data-state="triggered"] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n }\n\n @keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n ha-icon[data-domain="plant"][data-state="problem"],\n ha-icon[data-domain="zwave"][data-state="dead"] {\n color: var(--error-state-color, #db4437);\n }\n\n /* Color the icon if unavailable */\n ha-icon[data-state="unavailable"] {\n color: var(--state-icon-unavailable-color);\n }\n']);return a=function(){return e},e}r.d(t,{N:function(){return n}});var n=(0,r(15652).iv)(a())},3143:function(e,t,r){"use strict";var a=r(15652),n=r(49629),o=r(79865),i=r(56949),s=r(22311),c=r(36145),l=r(52797);r(16509);function u(){var e=m(["\n :host {\n position: relative;\n display: inline-block;\n width: 40px;\n color: var(--paper-item-icon-color, #44739e);\n border-radius: 50%;\n height: 40px;\n text-align: center;\n background-size: cover;\n line-height: 40px;\n vertical-align: middle;\n box-sizing: border-box;\n }\n :host(:focus) {\n outline: none;\n }\n :host(:not([icon]):focus) {\n border: 2px solid var(--divider-color);\n }\n :host([icon]:focus) {\n background: var(--divider-color);\n }\n ha-icon {\n transition: color 0.3s ease-in-out, filter 0.3s ease-in-out;\n }\n .missing {\n color: #fce588;\n }\n\n ","\n "]);return u=function(){return e},e}function d(e){return(d="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 h(){var e=m(["\n <ha-icon\n style=","\n data-domain=","\n data-state=","\n .icon=","\n ></ha-icon>\n "]);return h=function(){return e},e}function f(){var e=m([""]);return f=function(){return e},e}function p(){var e=m(['<div class="missing">\n <ha-icon icon="hass:alert"></ha-icon>\n </div>']);return p=function(){return e},e}function m(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(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,a=k(e);if(t){var n=k(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return g(this,r)}}function g(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?w(e):t}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(){_=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(a){t.forEach((function(t){var n=t.placement;if(t.kind===a&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var a=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===a?void 0:a.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],a=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!C(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),a.push.apply(a,t.finishers)}),this),!t)return{elements:r,finishers:a};var o=this.decorateConstructor(r,t);return a.push.apply(a,o.finishers),o.finishers=a,o},addElementPlacement:function(e,t,r){var a=t[e.placement];if(!r&&-1!==a.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");a.push(e.key)},decorateElement:function(e,t){for(var r=[],a=[],n=e.decorators,o=n.length-1;o>=0;o--){var i=t[e.placement];i.splice(i.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,n[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&a.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);r.push.apply(r,l)}}return{element:e,finishers:a,extras:r}},decorateConstructor:function(e,t){for(var r=[],a=t.length-1;a>=0;a--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[a])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var i=0;i<e.length-1;i++)for(var s=i+1;s<e.length;s++)if(e[i].key===e[s].key&&e[i].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[i].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 S(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)?S(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),a=String(e.placement);if("static"!==a&&"prototype"!==a&&"own"!==a)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 "'+a+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:a,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"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=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:P(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=P(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var a=(0,t[r])(e);if(void 0!==a){if("function"!=typeof a)throw new TypeError("Finishers must return a constructor.");e=a}}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 E(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 a={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(a.decorators=e.decorators),"field"===e.kind&&(a.initializer=e.value),a}function x(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function C(e){return e.decorators&&e.decorators.length}function O(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function P(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"!==d(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!==d(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var z=function(e,t,r,a){var n=_();if(a)for(var o=0;o<a.length;o++)n=a[o](n);var i=t((function(e){n.initializeInstanceElements(e,s.elements)}),r),s=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},a=0;a<e.length;a++){var n,o=e[a];if("method"===o.kind&&(n=t.find(r)))if(O(o.descriptor)||O(n.descriptor)){if(C(o)||C(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(C(o)){if(C(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}x(o,n)}else t.push(o)}return t}(i.d.map(E)),e);return n.initializeClassElements(i.F,s.elements),n.runClassFinishers(i.F,s.finishers)}(null,(function(e,t){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&&v(e,t)}(a,t);var r=y(a);function a(){var t;b(this,a);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t=r.call.apply(r,[this].concat(o)),e(w(t)),t}return a}(t),d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"overrideIcon",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"overrideImage",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"stateColor",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,reflect:!0,attribute:"icon"})],key:"_showIcon",value:function(){return!0}},{kind:"field",decorators:[(0,a.sz)()],key:"_iconStyle",value:function(){return{}}},{kind:"method",key:"render",value:function(){var e=this.stateObj;if(!e)return(0,a.dy)(p());if(!this._showIcon)return(0,a.dy)(f());var t=(0,s.N)(e);return(0,a.dy)(h(),(0,o.V)(this._iconStyle),(0,n.o)(this.stateColor||"light"===t&&!1!==this.stateColor?t:void 0),(0,i.q)(e),this.overrideIcon||(0,c.M)(e))}},{kind:"method",key:"updated",value:function(e){if(e.has("stateObj")&&this.stateObj){var t=this.stateObj,r={},a={backgroundImage:""};if(this._showIcon=!0,t)if((t.attributes.entity_picture_local||t.attributes.entity_picture)&&!this.overrideIcon||this.overrideImage){var n=this.overrideImage||t.attributes.entity_picture_local||t.attributes.entity_picture;this.hass&&(n=this.hass.hassUrl(n)),a.backgroundImage="url(".concat(n,")"),this._showIcon=!1}else if("on"===t.state){if(t.attributes.hs_color&&!1!==this.stateColor){var o=t.attributes.hs_color[0],i=t.attributes.hs_color[1];i>10&&(r.color="hsl(".concat(o,", 100%, ").concat(100-i/2,"%)"))}if(t.attributes.brightness&&!1!==this.stateColor){var s=t.attributes.brightness;if("number"!=typeof s){var c="Type error: state-badge expected number, but type of ".concat(t.entity_id,".attributes.brightness is ").concat(d(s)," (").concat(s,")");console.warn(c)}r.filter="brightness(".concat((s+245)/5,"%)")}}this._iconStyle=r,Object.assign(this.style,a)}}},{kind:"get",static:!0,key:"styles",value:function(){return(0,a.iv)(u(),l.N)}}]}}),a.oi);customElements.define("state-badge",z)}}]);
//# sourceMappingURL=chunk.7e51f8ec3347db9aebc3.js.map