UNPKG

iobroker.lovelace

Version:

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

2 lines 13.9 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["44959"],{5839:function(t,e,i){i.d(e,{v:()=>r});i(19083);var a=i(96194),o=i(73850);function r(t,e){const i=(0,o.M)(t.entity_id),r=void 0!==e?e:null==t?void 0:t.state;if(["button","event","input_button","scene"].includes(i))return r!==a.nZ;if((0,a.rk)(r))return!1;if(r===a.PX&&"alert"!==i)return!1;switch(i){case"alarm_control_panel":return"disarmed"!==r;case"alert":return"idle"!==r;case"cover":case"valve":return"closed"!==r;case"device_tracker":case"person":return"not_home"!==r;case"lawn_mower":return["mowing","error"].includes(r);case"lock":return"locked"!==r;case"media_player":return"standby"!==r;case"vacuum":return!["idle","docked","paused"].includes(r);case"plant":return"problem"===r;case"group":return["on","home","open","locked","problem"].includes(r);case"timer":return"active"===r;case"camera":return"streaming"===r}return!0}},42818:function(t,e,i){i.d(e,{Hh:()=>d,I2:()=>L,_w:()=>u,tD:()=>h});i(71695),i(92745),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);var a=i(96194),o=i(3582),r=i(76190),n=i(34798);var s=i(73850),c=i(5839);const l=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","lawn_mower","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum","valve","water_heater"]),d=(t,e)=>{if((void 0!==e?e:null==t?void 0:t.state)===a.nZ)return"var(--state-unavailable-color)";const i=h(t,e);return i?(0,r.I)(i):void 0},u=(t,e,i)=>{const a=void 0!==i?i:e.state,o=(0,c.v)(e,i),r=[],s=(0,n.l)(a,"_"),l=o?"active":"inactive",d=e.attributes.device_class;return d&&r.push(`--state-${t}-${d}-${s}-color`),r.push(`--state-${t}-${s}-color`,`--state-${t}-${l}-color`,`--state-${l}-color`),r},h=(t,e)=>{const i=void 0!==e?e:null==t?void 0:t.state,a=(0,s.M)(t.entity_id),r=t.attributes.device_class;if("sensor"===a&&"battery"===r){const t=(t=>{const e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(i);if(t)return[t]}if("group"===a){const i=(0,o.W)(t);if(i&&l.has(i))return u(i,t,e)}if(l.has(a))return u(a,t,e)},L=t=>{if(t.attributes.brightness&&"plant"!==(0,s.M)(t.entity_id)){return`brightness(${(t.attributes.brightness+245)/5}%)`}return""}},34798:function(t,e,i){i.d(e,{l:()=>a});i(69235),i(12385),i(19134),i(11740),i(97003);const a=(t,e="_")=>{const i="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·",a=`aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz${e}`,o=new RegExp(i.split("").join("|"),"g");let r;return""===t?r="":(r=t.toString().toLowerCase().replace(o,(t=>a.charAt(i.indexOf(t)))).replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),""),""===r&&(r="unknown")),r}},44705:function(t,e,i){i.d(e,{N:()=>o});let a;const o=(0,i(57243).iv)(a||(a=(t=>t)`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`))},5460:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(61701),o=i(72621),r=(i(71695),i(47021),i(57243)),n=i(50778),s=i(20552),c=i(69634),l=i(73850),d=i(59847),u=i(42818),h=i(44705),L=i(47844),v=i(350),C=i(51223),f=t([C]);C=(f.then?(await f)():f)[0];let b,_,p,y=t=>t;const m="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";let g=(0,a.Z)(null,(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"overrideIcon",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"overrideImage",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"stateColor",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"color",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"icon",value(){return!0}},{kind:"field",decorators:[(0,n.SB)()],key:"_iconStyle",value(){return{}}},{kind:"method",key:"connectedCallback",value:function(){var t,e;(0,o.Z)(i,"connectedCallback",this,3)([]),this.hasUpdated&&void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}},{kind:"method",key:"disconnectedCallback",value:function(){var t,e;(0,o.Z)(i,"disconnectedCallback",this,3)([]),void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&(this.style.backgroundImage="")}},{kind:"get",key:"_stateColor",value:function(){var t;const e=this.stateObj?(0,d.N)(this.stateObj):void 0;return null!==(t=this.stateColor)&&void 0!==t?t:"light"===e}},{kind:"method",key:"render",value:function(){const t=this.stateObj;if(!t&&!this.overrideIcon&&!this.overrideImage)return(0,r.dy)(b||(b=y`<div class="missing"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div>`),m);if(!this.icon)return r.Ld;const e=t?(0,d.N)(t):void 0;return(0,r.dy)(_||(_=y`<ha-state-icon .hass="${0}" style="${0}" data-domain="${0}" data-state="${0}" .icon="${0}" .stateObj="${0}"></ha-state-icon>`),this.hass,(0,c.V)(this._iconStyle),(0,s.o)(e),(0,s.o)(null==t?void 0:t.state),this.overrideIcon,t)}},{kind:"method",key:"willUpdate",value:function(t){if((0,o.Z)(i,"willUpdate",this,3)([t]),!(t.has("stateObj")||t.has("overrideImage")||t.has("overrideIcon")||t.has("stateColor")||t.has("color")))return;const e=this.stateObj,a={};let r="";if(this.icon=!0,e){const t=(0,l.M)(e.entity_id);if(void 0===this.overrideImage)if(!e.attributes.entity_picture_local&&!e.attributes.entity_picture||this.overrideIcon){if(this.color)a.color=this.color;else if(this._stateColor){const t=(0,u.Hh)(e);if(t&&(a.color=t),e.attributes.rgb_color&&(a.color=`rgb(${e.attributes.rgb_color.join(",")})`),e.attributes.brightness){const t=e.attributes.brightness;if("number"!=typeof t){const i=`Type error: state-badge expected number, but type of ${e.entity_id}.attributes.brightness is ${typeof t} (${t})`;console.warn(i)}a.filter=(0,u.I2)(e)}if(e.attributes.hvac_action){const t=e.attributes.hvac_action;t in v.hB?a.color=(0,u.Hh)(e,v.hB[t]):delete a.color}}}else{let i=e.attributes.entity_picture_local||e.attributes.entity_picture;this.hass&&(i=this.hass.hassUrl(i)),"camera"===t&&(i=(0,L.Ch)(i,80,80)),r=`url(${i})`,this.icon=!1}else if(this.overrideImage){let t=this.overrideImage;this.hass&&(t=this.hass.hassUrl(t)),r=`url(${t})`,this.icon=!1}"update"===t?this.style.borderRadius="0":"media_player"!==t&&"camera"!==t||(this.style.borderRadius="8%")}this._iconStyle=a,this.style.backgroundImage=r}},{kind:"get",static:!0,key:"styles",value:function(){return[h.N,(0,r.iv)(p||(p=y`:host{position:relative;display:inline-block;width:40px;color:var(--paper-item-icon-color,#44739e);border-radius:50%;height:40px;text-align:center;background-size:cover;line-height:40px;vertical-align:middle;box-sizing:border-box;--state-inactive-color:initial}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`))]}}]}}),r.oi);customElements.define("state-badge",g),e()}catch(b){e(b)}}))},350:function(t,e,i){i.d(e,{T1:()=>a,ZS:()=>n,hB:()=>s,pi:()=>o,vn:()=>l});i(52805);const a="none";let o=66977!=i.j?function(t){return t[t.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",t[t.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",t[t.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",t[t.FAN_MODE=8]="FAN_MODE",t[t.PRESET_MODE=16]="PRESET_MODE",t[t.SWING_MODE=32]="SWING_MODE",t[t.AUX_HEAT=64]="AUX_HEAT",t[t.TURN_OFF=128]="TURN_OFF",t[t.TURN_ON=256]="TURN_ON",t[t.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",t}({}):null;const r=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce(((t,e,i)=>(t[e]=i,t)),{}),n=(t,e)=>r[t]-r[e],s={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},c=66977!=i.j?{cool:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",dry:"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",fan_only:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",auto:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22C12.4 22 12.7 22 13.1 21.9L15.4 15.3L14.8 14.7C15.5 14 16 13 16 11.9C16 11.2 15.8 10.5 15.4 9.9L17.6 7.7C18.5 9 19 10.4 19 12H20C20.3 12 20.6 12.1 20.8 12.2C20.8 12.2 20.9 12.2 20.9 12.3C21.3 12.5 21.7 12.9 21.9 13.4C22 12.9 22 12.5 22 12C22 6.5 17.5 2 12 2M14 8.6C13.4 8.2 12.7 8 12 8C9.8 8 8 9.8 8 12C8 13.1 8.4 14.1 9.2 14.8L7.1 16.9C5.8 15.7 5 13.9 5 12C5 8.1 8.1 5 12 5C13.6 5 15 5.5 16.2 6.4L14 8.6M20 14H18L14.8 23H16.7L17.4 21H20.6L21.3 23H23.2L20 14M17.8 19.7L19 16L20.2 19.7H17.8Z",heat:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",off:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",heat_cool:"M12.92 1.58L11.18 2.58L12.39 4.67L11.8 6.85L9 7.6L7.38 6L7.42 3.59L5.43 3.59L5.43 5.42L3.59 5.42L3.6 7.42L6 7.42L7.65 9.03L6.9 11.82L4.68 12.4L2.59 11.2L1.59 12.93L3.17 13.84L2.26 15.42L4 16.42L5.19 14.33L7.42 13.75L7.92 14.26L9.32 12.86L8.78 12.32L9.53 9.54L12.32 8.78L12.85 9.32L14.26 7.91L13.73 7.37L14.32 5.19L16.41 4L15.41 2.25L13.83 3.16L12.92 1.58M20.72 4L4 20.72L5.27 22L10.16 17.11C10.63 17.43 11.15 17.68 11.71 17.83C14.38 18.55 17.12 16.96 17.83 14.29C18.22 12.86 17.93 11.36 17.11 10.16L22 5.27L20.72 4M18.74 9C19.18 9.63 19.53 10.38 19.75 11.19C19.97 12 20.03 12.81 19.96 13.61L22.65 10.41L18.74 9M19.32 15.95C19 16.67 18.5 17.35 17.93 17.94C17.34 18.53 16.66 19 15.96 19.34L20.05 20.06L19.32 15.95M9 18.71L10.41 22.66L13.59 19.95C12.81 20 12 19.97 11.19 19.76C10.36 19.54 9.62 19.17 9 18.71Z"}:null,l=t=>c[t]||"M16.95,16.95L14.83,14.83C15.55,14.1 16,13.1 16,12C16,11.26 15.79,10.57 15.43,10L17.6,7.81C18.5,9 19,10.43 19,12C19,13.93 18.22,15.68 16.95,16.95M12,5C13.57,5 15,5.5 16.19,6.4L14,8.56C13.43,8.21 12.74,8 12,8A4,4 0 0,0 8,12C8,13.1 8.45,14.1 9.17,14.83L7.05,16.95C5.78,15.68 5,13.93 5,12A7,7 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"},3582:function(t,e,i){i.d(e,{W:()=>o});i(71695),i(9359),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);var a=i(73850);const o=t=>{const e=t.attributes.entity_id||[],i=[...new Set(e.map((t=>(0,a.M)(t))))];return 1===i.length?i[0]:void 0}},76190:function(t,e,i){i.d(e,{I:()=>a,g:()=>o});i(71695),i(52805),i(61495),i(9359),i(48136),i(97499),i(81804),i(47021);function a(t){return Array.isArray(t)?t.reverse().reduce(((t,e)=>`var(${e}${t?`, ${t}`:""})`),void 0):`var(${t})`}function o(t,e){if(Array.isArray(t))for(const i of t){const t=o(i,e);if(t)return t}else if(t.endsWith("-color"))return e.getPropertyValue(t).trim()||void 0}}}]); //# sourceMappingURL=44959.91f48db4c7d18b27.js.map