UNPKG

iobroker.lovelace

Version:

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

2 lines 14.2 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["29477"],{75011:function(e,t,n){n.d(t,{I:()=>r,k:()=>i});n(71695),n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814),n(47021);const i=new Set(["primary","accent","disabled","red","pink","purple","deep-purple","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","deep-orange","brown","light-grey","grey","dark-grey","blue-grey","black","white"]);function r(e){return i.has(e)?`var(--${e}-color)`:e}},94947:function(e,t,n){n.a(e,(async function(e,i){try{n.d(t,{G:()=>l});var r=n(16485),o=n(27486),a=n(27046),u=e([r,a]);[r,a]=u.then?(await u)():u;const s=(0,o.Z)((e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"}))),l=(e,t,n,i=!0)=>{const r=(0,a.W)(e,n,t);return i?s(t).format(r.value,r.unit):Intl.NumberFormat(t.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};i()}catch(s){i(s)}}))},34618:function(e,t,n){n.d(t,{N:()=>i});const i=(e,t=2)=>Math.round(e*10**t)/10**t},27046:function(e,t,n){n.a(e,(async function(e,i){try{n.d(t,{W:()=>m});n(19423);var r=n(13809),o=n(29558),a=n(94763),u=n(19631),s=e([u]);u=(s.then?(await s)():s)[0];const d=1e3,c=60,h=60*c;function m(e,t=Date.now(),n,i={}){const s=Object.assign(Object.assign({},g),i||{}),l=(+e-+t)/d;if(Math.abs(l)<s.second)return{value:Math.round(l),unit:"second"};const m=l/c;if(Math.abs(m)<s.minute)return{value:Math.round(m),unit:"minute"};const y=l/h;if(Math.abs(y)<s.hour)return{value:Math.round(y),unit:"hour"};const b=new Date(e),f=new Date(t);b.setHours(0,0,0,0),f.setHours(0,0,0,0);const v=(0,r.j)(b,f);if(0===v)return{value:Math.round(y),unit:"hour"};if(Math.abs(v)<s.day)return{value:v,unit:"day"};const p=(0,u.Bt)(n),k=(0,o.z)(b,{weekStartsOn:p}),w=(0,o.z)(f,{weekStartsOn:p}),_=(0,a.p)(k,w);if(0===_)return{value:v,unit:"day"};if(Math.abs(_)<s.week)return{value:_,unit:"week"};const C=b.getFullYear()-f.getFullYear(),E=12*C+b.getMonth()-f.getMonth();return 0===E?{value:_,unit:"week"}:Math.abs(E)<s.month||0===C?{value:E,unit:"month"}:{value:Math.round(C),unit:"year"}}const g={second:45,minute:45,hour:22,day:5,week:4,month:11};i()}catch(l){i(l)}}))},34273:function(e,t,n){var i=n(61701),r=n(72621),o=(n(71695),n(9359),n(31526),n(47021),n(22997),n(57243)),a=n(50778),u=n(5111),s=n(76525);let l,d,c=e=>e;(0,i.Z)([(0,a.Mo)("ha-button-menu")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",key:s.gA,value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"corner",value(){return"BOTTOM_START"}},{kind:"field",decorators:[(0,a.Cb)({attribute:"menu-corner"})],key:"menuCorner",value(){return"START"}},{kind:"field",decorators:[(0,a.Cb)({type:Number})],key:"x",value(){return null}},{kind:"field",decorators:[(0,a.Cb)({type:Number})],key:"y",value(){return null}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"multi",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"activatable",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"fixed",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value(){return!1}},{kind:"field",decorators:[(0,a.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.items}},{kind:"get",key:"selected",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.selected}},{kind:"method",key:"focus",value:function(){var e,t;null!==(e=this._menu)&&void 0!==e&&e.open?this._menu.focusItemAtIndex(0):null===(t=this._triggerButton)||void 0===t||t.focus()}},{kind:"method",key:"render",value:function(){return(0,o.dy)(l||(l=c` <div @click="${0}"> <slot name="trigger" @slotchange="${0}"></slot> </div> <mwc-menu .corner="${0}" .menuCorner="${0}" .fixed="${0}" .multi="${0}" .activatable="${0}" .y="${0}" .x="${0}"> <slot></slot> </mwc-menu> `),this._handleClick,this._setTriggerAria,this.corner,this.menuCorner,this.fixed,this.multi,this.activatable,this.y,this.x)}},{kind:"method",key:"firstUpdated",value:function(e){(0,r.Z)(n,"firstUpdated",this,3)([e]),"rtl"===u.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((e=>{const t=document.createElement("style");t.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",e.shadowRoot.appendChild(t)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(d||(d=c`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`))}}]}}),o.oi)},51223:function(e,t,n){n.a(e,(async function(e,t){try{var i=n(61701),r=(n(71695),n(47021),n(57243)),o=n(50778),a=n(94571),u=n(59847),s=n(45729),l=(n(65981),n(37583),e([s]));s=(l.then?(await l)():l)[0];let d,c,h,m,g=e=>e;(0,i.Z)([(0,o.Mo)("ha-state-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"stateValue",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){var e,t;const n=this.icon||this.stateObj&&(null===(e=this.hass)||void 0===e||null===(e=e.entities[this.stateObj.entity_id])||void 0===e?void 0:e.icon)||(null===(t=this.stateObj)||void 0===t?void 0:t.attributes.icon);if(n)return(0,r.dy)(d||(d=g`<ha-icon .icon="${0}"></ha-icon>`),n);if(!this.stateObj)return r.Ld;if(!this.hass)return this._renderFallback();const i=(0,s.gD)(this.hass,this.stateObj,this.stateValue).then((e=>e?(0,r.dy)(c||(c=g`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback()));return(0,r.dy)(h||(h=g`${0}`),(0,a.C)(i))}},{kind:"method",key:"_renderFallback",value:function(){const e=(0,u.N)(this.stateObj);return(0,r.dy)(m||(m=g` <ha-svg-icon .path="${0}"></ha-svg-icon> `),s.Ls[e]||s.Rb)}}]}}),r.oi);t()}catch(d){t(d)}}))},96194:function(e,t,n){n.d(t,{ON:()=>a,PX:()=>u,V_:()=>s,lz:()=>o,nZ:()=>r,rk:()=>d});var i=n(92636);const r="unavailable",o="unknown",a="on",u="off",s=[r,o],l=[r,o,u],d=(0,i.z)(s);(0,i.z)(l)},58968:function(e,t,n){n.d(t,{MV:()=>l,Wg:()=>u,Xk:()=>a,aT:()=>i,b_:()=>o,yP:()=>s});n(88044);const i=(e,t)=>e.callApi("POST","tts_get_url",t),r="media-source://tts/",o=e=>e.startsWith(r),a=e=>e.substring(19),u=(e,t,n)=>e.callWS({type:"tts/engine/list",language:t,country:n}),s=(e,t)=>e.callWS({type:"tts/engine/get",engine_id:t}),l=(e,t,n)=>e.callWS({type:"tts/engine/voices",engine_id:t,language:n})},40249:function(e,t,n){n.d(t,{ED:()=>h,Fr:()=>a,N2:()=>o,Tw:()=>d,Xm:()=>c});n(52247),n(19083),n(71695),n(40251),n(61006),n(47021);var i=n(36522),r=n(17951);const o=(e,t)=>({type:"error",error:e,origConfig:t}),a=(e,t)=>({type:"error",error:e,origConfig:t}),u=(e,t)=>{const n=document.createElement(e);return n.setConfig(t),n},s=(e,t,i)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([n.e("35671"),n.e("2142"),n.e("8795"),n.e("32146"),n.e("31241"),n.e("35152"),n.e("63055"),n.e("70147"),n.e("79931"),n.e("44251"),n.e("65005"),n.e("60487"),n.e("3371"),n.e("1466"),n.e("38326"),n.e("10745"),n.e("70639"),n.e("72974"),n.e("86915"),n.e("51098")]).then(n.bind(n,72814)),customElements.whenDefined("hui-error-badge").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(a(t,i)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([n.e("35671"),n.e("2142"),n.e("8795"),n.e("32146"),n.e("31241"),n.e("35152"),n.e("63055"),n.e("70147"),n.e("79931"),n.e("44251"),n.e("65005"),n.e("60487"),n.e("3371"),n.e("1466"),n.e("38326"),n.e("10745"),n.e("70639"),n.e("72974"),n.e("86915"),n.e("98170")]).then(n.bind(n,5031)),customElements.whenDefined("hui-error-heading-badge").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,i)):(e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.all([n.e("2142"),n.e("8795"),n.e("9962")]).then(n.bind(n,5252)),customElements.whenDefined("hui-error-card").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(o(t,i)),l=e=>(0,r.IT)(e)?(0,r.V0)(e):void 0,d=(e,t,n,i,r,o)=>{try{return c(e,t,n,i,r,o)}catch(a){return console.error(e,t.type,a),s(e,a.message,t)}},c=(e,t,n,r,o,a)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||a||o&&"entity"in t))throw new Error("No card type configured");const d=t.type?l(t.type):void 0;if(d)return((e,t,n)=>{if(customElements.get(t))return u(t,n);const r=s(e,`Custom element doesn't exist: ${t}.`,n);if(!t.includes("-"))return r;r.style.display="None";const o=window.setTimeout((()=>{r.style.display=""}),2e3);return customElements.whenDefined(t).then((()=>{clearTimeout(o),(0,i.B)(r,"ll-rebuild")})),r})(e,d,t);let c;if(o&&!t.type&&t.entity){c=`${o[t.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else c=t.type||a;if(void 0===c)throw new Error("No type specified");const h=`hui-${c}-${e}`;if(r&&c in r)return r[c](),((e,t)=>{if(customElements.get(e))return u(e,t);const n=document.createElement(e);return customElements.whenDefined(e).then((()=>{try{customElements.upgrade(n),(0,i.B)(n,"ll-upgrade"),n.setConfig(t)}catch(e){(0,i.B)(n,"ll-rebuild")}})),n})(h,t);if(n&&n.has(c))return u(h,t);throw new Error(`Unknown type encountered: ${c}`)},h=async(e,t,n,i)=>{const r=l(e);if(r){const e=customElements.get(r);if(e)return e;if(!r.includes("-"))throw new Error(`Custom element not found: ${r}`);return new Promise(((e,t)=>{setTimeout((()=>t(new Error(`Custom element not found: ${r}`))),2e3),customElements.whenDefined(r).then((()=>e(customElements.get(r))))}))}const o=`hui-${e}-${t}`,a=customElements.get(o);if(n&&n.has(e))return a;if(i&&e in i)return a||i[e]().then((()=>customElements.get(o)));throw new Error(`Unknown type: ${e}`)}},46542:function(e,t,n){n.a(e,(async function(e,i){try{n.d(t,{T:()=>k,m:()=>p});n(71695),n(40251),n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814),n(47021);var r=n(72053),o=n(35659),a=n(52809),u=n(40165),s=n(82114),l=n(21474),d=n(31087),c=n(90296),h=n(42135),m=n(40806),g=n(40249),y=e([r,o,a,u,s,l,d,c,h,m]);[r,o,a,u,s,l,d,c,h,m]=y.then?(await y)():y;const b=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),f={"button-entity":()=>n.e("44821").then(n.bind(n,35154)),"climate-entity":()=>n.e("79702").then(n.bind(n,54222)),"cover-entity":()=>n.e("50764").then(n.bind(n,4806)),"date-entity":()=>Promise.all([n.e("46379"),n.e("50013")]).then(n.bind(n,61351)),"datetime-entity":()=>Promise.all([n.e("46379"),n.e("41258"),n.e("35671"),n.e("3134"),n.e("38336"),n.e("99113")]).then(n.bind(n,67429)),"event-entity":()=>Promise.resolve().then(n.bind(n,72053)),"group-entity":()=>n.e("83537").then(n.bind(n,40445)),"input-button-entity":()=>n.e("5380").then(n.bind(n,57548)),"humidifier-entity":()=>n.e("84999").then(n.bind(n,88916)),"input-datetime-entity":()=>Promise.all([n.e("46379"),n.e("41258"),n.e("35671"),n.e("38336"),n.e("55119")]).then(n.bind(n,67223)),"input-number-entity":()=>Promise.all([n.e("46379"),n.e("84605")]).then(n.bind(n,90516)),"input-select-entity":()=>Promise.all([n.e("41258"),n.e("35671"),n.e("66868")]).then(n.bind(n,43)),"input-text-entity":()=>Promise.all([n.e("46379"),n.e("14673")]).then(n.bind(n,22623)),"lock-entity":()=>n.e("99689").then(n.bind(n,65751)),"number-entity":()=>Promise.all([n.e("46379"),n.e("88187")]).then(n.bind(n,77288)),"select-entity":()=>Promise.all([n.e("41258"),n.e("35671"),n.e("86857")]).then(n.bind(n,64827)),"text-entity":()=>Promise.all([n.e("46379"),n.e("86449")]).then(n.bind(n,90689)),"time-entity":()=>Promise.all([n.e("46379"),n.e("41258"),n.e("35671"),n.e("38336"),n.e("63586")]).then(n.bind(n,4671)),"timer-entity":()=>n.e("7618").then(n.bind(n,45363)),"update-entity":()=>n.e("58400").then(n.bind(n,97604)),"valve-entity":()=>n.e("96347").then(n.bind(n,97937)),conditional:()=>n.e("79220").then(n.bind(n,24272)),"weather-entity":()=>Promise.all([n.e("44251"),n.e("28565")]).then(n.bind(n,51973)),divider:()=>n.e("73576").then(n.bind(n,70568)),section:()=>n.e("26438").then(n.bind(n,93665)),weblink:()=>n.e("41871").then(n.bind(n,69819)),cast:()=>n.e("45006").then(n.bind(n,15638)),buttons:()=>Promise.all([n.e("59821"),n.e("73644")]).then(n.bind(n,58574)),attribute:()=>Promise.resolve().then(n.bind(n,90296)),text:()=>n.e("52767").then(n.bind(n,68291))},v={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},p=e=>(0,g.Tw)("row",e,b,f,v,void 0),k=e=>(0,g.ED)(e,"row",b,f);i()}catch(b){i(b)}}))}}]); //# sourceMappingURL=29477.d364544e389c529f.js.map