UNPKG

iobroker.lovelace

Version:

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

5 lines 17.6 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["96122"],{29095:function(e,t,r){r.a(e,(async function(e,t){try{var n=r(61701),i=(r(71695),r(47021),r(57243)),o=r(50778),s=(r(59826),r(17170)),a=(r(37583),e([s]));s=(a.then?(await a)():a)[0];let c,l,d,u,h,m,f=e=>e;const p="M2.2,16.06L3.88,12L2.2,7.94L6.26,6.26L7.94,2.2L12,3.88L16.06,2.2L17.74,6.26L21.8,7.94L20.12,12L21.8,16.06L17.74,17.74L16.06,21.8L12,20.12L7.94,21.8L6.26,17.74L2.2,16.06M13,17V15H11V17H13M13,13V7H11V13H13Z",v="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";(0,n.Z)([(0,o.Mo)("ha-progress-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"progress",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"raised",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"unelevated",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_result",value:void 0},{kind:"method",key:"render",value:function(){const e=this._result||this.progress;return(0,i.dy)(c||(c=f` <ha-button .raised="${0}" .label="${0}" .unelevated="${0}" .disabled="${0}" class="${0}"> <slot name="icon" slot="icon"></slot> <slot></slot> </ha-button> ${0} `),this.raised,this.label,this.unelevated,this.disabled||this.progress,this._result||"",e?(0,i.dy)(l||(l=f` <div class="progress"> ${0} </div> `),"success"===this._result?(0,i.dy)(d||(d=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),v):"error"===this._result?(0,i.dy)(u||(u=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),p):this.progress?(0,i.dy)(h||(h=f`<ha-spinner size="small"></ha-spinner>`)):i.Ld):i.Ld)}},{kind:"method",key:"actionSuccess",value:function(){this._setResult("success")}},{kind:"method",key:"actionError",value:function(){this._setResult("error")}},{kind:"method",key:"_setResult",value:function(e){this._result=e,setTimeout((()=>{this._result=void 0}),2e3)}},{kind:"field",static:!0,key:"styles",value(){return(0,i.iv)(m||(m=f`:host{outline:0;display:inline-block;position:relative;pointer-events:none}ha-button{transition:all 1s;pointer-events:initial}ha-button.success{--mdc-theme-primary:white;background-color:var(--success-color);transition:none;border-radius:4px;pointer-events:none}ha-button[raised].success,ha-button[unelevated].success{--mdc-theme-primary:var(--success-color);--mdc-theme-on-primary:white}ha-button.error{--mdc-theme-primary:white;background-color:var(--error-color);transition:none;border-radius:4px;pointer-events:none}ha-button[raised].error,ha-button[unelevated].error{--mdc-theme-primary:var(--error-color);--mdc-theme-on-primary:white}.progress{bottom:4px;position:absolute;text-align:center;top:4px;width:100%}ha-svg-icon{color:#fff}ha-button.error slot,ha-button.success slot{visibility:hidden}:host([destructive]){--mdc-theme-primary:var(--error-color)}`))}}]}}),i.oi);t()}catch(c){t(c)}}))},17170:function(e,t,r){r.a(e,(async function(e,n){try{r.r(t),r.d(t,{HaSpinner:()=>m});var i=r(61701),o=r(72621),s=(r(71695),r(47021),r(97677)),a=r(43580),c=r(57243),l=r(50778),d=e([s]);s=(d.then?(await d)():d)[0];let u,h=e=>e,m=(0,i.Z)([(0,l.Mo)("ha-spinner")],(function(e,t){class r extends t{constructor(...t){super(...t),e(this)}}return{F:r,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(r,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[a.Z,(0,c.iv)(u||(u=h`:host{--indicator-color:var( --ha-spinner-indicator-color, var(--primary-color) );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),s.Z);n()}catch(u){n(u)}}))},31221:function(e,t,r){r.a(e,(async function(e,n){try{r.r(t);var i=r(61701),o=r(72621),s=(r(52247),r(71695),r(9359),r(70104),r(40251),r(47021),r(57243)),a=r(50778),c=r(82393),l=r(73850),d=(r(54977),r(72099)),u=r(69223),h=r(44804),m=e([h]);h=(m.then?(await m)():m)[0];let f,p,v=e=>e;(0,i.Z)([(0,a.Mo)("hui-picture-elements-card")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"method",static:!0,key:"getConfigElement",value:async function(){return await Promise.all([r.e("41258"),r.e("95444"),r.e("37008"),r.e("500")]).then(r.bind(r,47273)),document.createElement("hui-picture-elements-card-editor")}},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_elements",value:void 0},{kind:"method",static:!0,key:"getStubConfig",value:function(e,t,r){return{type:"picture-elements",elements:[{type:"state-badge",entity:(0,u.j)(e,1,t,r,["sensor","binary_sensor"])[0]||"",style:{top:"32%",left:"40%"}}],image:"https://demo.home-assistant.io/stub_config/floorplan.png"}}},{kind:"field",decorators:[(0,a.SB)()],key:"_config",value:void 0},{kind:"method",key:"getCardSize",value:function(){return 4}},{kind:"method",key:"setConfig",value:function(e){if(!e)throw new Error("Invalid configuration");if(!(e.image||e.image_entity||e.camera_image||e.state_image)||e.state_image&&!e.entity)throw new Error("Image required");if(!Array.isArray(e.elements))throw new Error("Elements required");this._config=e,this._elements=e.elements.map((e=>this._createElement(e)))}},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(n,"updated",this,3)([e]),!this._config||!this.hass)return;if(this._elements&&e.has("hass"))for(const n of this._elements)n.hass=this.hass;const t=e.get("hass"),r=e.get("_config");t&&r&&t.themes===this.hass.themes&&r.theme===this._config.theme||(0,c.R)(this,this.hass.themes,this._config.theme)}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return s.Ld;let e=this._config.image;if(this._config.image_entity){const t=this.hass.states[this._config.image_entity];switch((0,l.M)(this._config.image_entity)){case"image":e=(0,d.U)(t);break;case"person":t.attributes.entity_picture&&(e=t.attributes.entity_picture)}}return(0,s.dy)(f||(f=v` <ha-card .header="${0}"> <div id="root"> <hui-image .hass="${0}" .image="${0}" .stateImage="${0}" .stateFilter="${0}" .cameraImage="${0}" .cameraView="${0}" .entity="${0}" .aspectRatio="${0}" .darkModeFilter="${0}" .darkModeImage="${0}"></hui-image> ${0} </div> </ha-card> `),this._config.title,this.hass,e,this._config.state_image,this._config.state_filter,this._config.camera_image,this._config.camera_view,this._config.entity,this._config.aspect_ratio,this._config.dark_mode_filter,this._config.dark_mode_image,this._elements)}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(p||(p=v`#root{position:relative}.element{position:absolute;transform:translate(-50%,-50%)}ha-card{overflow:hidden;height:100%;box-sizing:border-box}`))}},{kind:"method",key:"_createElement",value:function(e){const t=(0,h.O)(e);return this.hass&&(t.hass=this.hass),t.addEventListener("ll-rebuild",(r=>{r.stopPropagation(),this._rebuildElement(t,e)}),{once:!0}),t}},{kind:"method",key:"_rebuildElement",value:function(e,t){const r=this._createElement(t);e.parentElement&&e.parentElement.replaceChild(r,e),this._elements=this._elements.map((t=>t===e?r:t))}}]}}),s.oi);n()}catch(f){n(f)}}))},52032:function(e,t,r){r.a(e,(async function(e,n){try{r.d(t,{w:()=>h});r(71695),r(19423),r(92519),r(42179),r(89256),r(24931),r(88463),r(57449),r(19814),r(47021);var i=r(35729),o=(r(83442),r(92263)),s=r(15367),a=r(56332),c=r(13888),l=(r(9427),r(40249)),d=e([i,o,s,a,c]);[i,o,s,a,c]=d.then?(await d)():d;const u=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),h=e=>("action-button"===e.type&&(e=Object.assign(Object.assign({},e),{},{type:"service-button"})),(0,l.Tw)("element",e,u));n()}catch(u){n(u)}}))},86256:function(e,t,r){var n=r(88045),i=r(72616),o=r(95011),s=RangeError;e.exports=function(e){var t=i(o(this)),r="",a=n(e);if(a<0||a===1/0)throw new s("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r}},35638:function(e,t,r){var n=r(72878);e.exports=n(1..valueOf)},49278:function(e,t,r){var n=r(40810),i=r(72878),o=r(88045),s=r(35638),a=r(86256),c=r(29660),l=RangeError,d=String,u=Math.floor,h=i(a),m=i("".slice),f=i(1..toFixed),p=function(e,t,r){return 0===t?r:t%2==1?p(e,t-1,r*e):p(e*e,t/2,r)},v=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=u(i/1e7)},g=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=u(n/t),n=n%t*1e7},y=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=d(e[t]);r=""===r?n:r+h("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:c((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!c((function(){f({})}))},{toFixed:function(e){var t,r,n,i,a=s(this),c=o(e),u=[0,0,0,0,0,0],f="",b="0";if(c<0||c>20)throw new l("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return d(a);if(a<0&&(f="-",a=-a),a>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(a*p(2,69,1))-69)<0?a*p(2,-t,1):a/p(2,t,1),r*=4503599627370496,(t=52-t)>0){for(v(u,0,r),n=c;n>=7;)v(u,1e7,0),n-=7;for(v(u,p(10,n,1),0),n=t-1;n>=23;)g(u,1<<23),n-=23;g(u,1<<n),v(u,1,1),g(u,2),b=y(u)}else v(u,0,r),v(u,1<<-t,0),b=y(u)+h("0",c);return b=c>0?f+((i=b.length)<=c?"0."+h("0",c-i)+b:m(b,0,i-c)+"."+m(b,i-c)):f+b}})},48734:function(e,t,r){r.a(e,(async function(e,n){try{r.d(t,{P5:()=>m,Ve:()=>p});var i=r(16485),o=(r(71695),r(9359),r(70104),r(19423),r(19134),r(92519),r(42179),r(89256),r(24931),r(88463),r(57449),r(19814),r(97003),r(47021),e([i]));i=(o.then?(await o)():o)[0];const a=new Set,c=new Map;let l,d="ltr",u="en";const h="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(h){const v=new MutationObserver(f);d=document.documentElement.dir||"ltr",u=document.documentElement.lang||navigator.language,v.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function m(...e){e.map((e=>{const t=e.$code.toLowerCase();c.has(t)?c.set(t,Object.assign(Object.assign({},c.get(t)),e)):c.set(t,e),l||(l=e)})),f()}function f(){h&&(d=document.documentElement.dir||"ltr",u=document.documentElement.lang||navigator.language),[...a.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}class p{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){a.add(this.host)}hostDisconnected(){a.delete(this.host)}dir(){return`${this.host.dir||d}`.toLowerCase()}lang(){return`${this.host.lang||u}`.toLowerCase()}getTranslationData(e){var t,r;const n=new Intl.Locale(e.replace(/_/g,"-")),i=null==n?void 0:n.language.toLowerCase(),o=null!==(r=null===(t=null==n?void 0:n.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:"";return{locale:n,language:i,region:o,primary:c.get(`${i}-${o}`),secondary:c.get(i)}}exists(e,t){var r;const{primary:n,secondary:i}=this.getTranslationData(null!==(r=t.lang)&&void 0!==r?r:this.lang());return t=Object.assign({includeFallback:!1},t),!!(n&&n[e]||i&&i[e]||t.includeFallback&&l&&l[e])}term(e,...t){const{primary:r,secondary:n}=this.getTranslationData(this.lang());let i;if(r&&r[e])i=r[e];else if(n&&n[e])i=n[e];else{if(!l||!l[e])return console.error(`No translation found for: ${String(e)}`),String(e);i=l[e]}return"function"==typeof i?i(...t):i}date(e,t){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),t).format(e)}number(e,t){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),t).format(e)}relativeTime(e,t,r){return new Intl.RelativeTimeFormat(this.lang(),r).format(e,t)}}n()}catch(s){n(s)}}))},68783:function(e,t,r){r.a(e,(async function(e,n){try{r.d(t,{A:()=>d});r(71695),r(47021);var i=r(64699),o=r(15073),s=r(81048),a=r(31027),c=r(57243),l=e([o]);o=(l.then?(await l)():l)[0];let u,h=e=>e;var d=class extends a.P{constructor(){super(...arguments),this.localize=new o.V(this)}render(){return(0,c.dy)(u||(u=h` <svg part="base" class="spinner" role="progressbar" aria-label="${0}"> <circle class="spinner__track"></circle> <circle class="spinner__indicator"></circle> </svg> `),this.localize.term("loading"))}};d.styles=[s.N,i.D],n()}catch(u){n(u)}}))},31027:function(e,t,r){r.d(t,{P:()=>a});r(71695),r(9359),r(31526),r(46692),r(47021);var n,i=r(52812),o=r(57243),s=r(50778),a=class extends o.oi{constructor(){super(),(0,i.Ko)(this,n,!1),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}emit(e,t){const r=new CustomEvent(e,(0,i.ih)({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(r),r}static define(e,t=this,r={}){const n=customElements.get(e);if(!n){try{customElements.define(e,t,r)}catch(s){customElements.define(e,class extends t{},r)}return}let i=" (unknown version)",o=i;"version"in t&&t.version&&(i=" v"+t.version),"version"in n&&n.version&&(o=" v"+n.version),i&&o&&i===o||console.warn(`Attempted to register <${e}>${i}, but <${e}>${o} has already been registered.`)}attributeChangedCallback(e,t,r){(0,i.ac)(this,n)||(this.constructor.elementProperties.forEach(((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])})),(0,i.qx)(this,n,!0)),super.attributeChangedCallback(e,t,r)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach(((t,r)=>{e.has(r)&&null==this[r]&&(this[r]=t)}))}};n=new WeakMap,a.version="2.20.1",a.dependencies={},(0,i.u2)([(0,s.Cb)()],a.prototype,"dir",2),(0,i.u2)([(0,s.Cb)()],a.prototype,"lang",2)},15073:function(e,t,r){r.a(e,(async function(e,n){try{r.d(t,{V:()=>a});var i=r(21262),o=r(48734),s=e([o,i]);[o,i]=s.then?(await s)():s;var a=class extends o.Ve{};(0,o.P5)(i.K),n()}catch(c){n(c)}}))},21262:function(e,t,r){r.a(e,(async function(e,n){try{r.d(t,{K:()=>a});var i=r(48734),o=e([i]);i=(o.then?(await o)():o)[0];var s={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format"};(0,i.P5)(s);var a=s;n()}catch(c){n(c)}}))},64699:function(e,t,r){r.d(t,{D:()=>i});let n;var i=(0,r(57243).iv)(n||(n=(e=>e)`:host{--track-width:2px;--track-color:rgb(128 128 128 / 25%);--indicator-color:var(--sl-color-primary-600);--speed:2s;display:inline-flex;width:1em;height:1em;flex:none}.spinner{flex:1 1 auto;height:100%;width:100%}.spinner__indicator,.spinner__track{fill:none;stroke-width:var(--track-width);r:calc(0.5em - var(--track-width)/ 2);cx:0.5em;cy:0.5em;transform-origin:50% 50%}.spinner__track{stroke:var(--track-color);transform-origin:0% 0%}.spinner__indicator{stroke:var(--indicator-color);stroke-linecap:round;stroke-dasharray:150% 75%;animation:spin var(--speed) linear infinite}@keyframes spin{0%{transform:rotate(0deg);stroke-dasharray:0.05em,3em}50%{transform:rotate(450deg);stroke-dasharray:1.375em,1.375em}100%{transform:rotate(1080deg);stroke-dasharray:0.05em,3em}}`))},52812:function(e,t,r){r.d(t,{EZ:()=>m,Ko:()=>g,ac:()=>v,ih:()=>h,qx:()=>y,u2:()=>f});r(63721),r(52247),r(71695),r(40251),r(47021);var n=Object.defineProperty,i=Object.defineProperties,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=e=>{throw TypeError(e)},u=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))c.call(t,r)&&u(e,r,t[r]);if(a)for(var r of a(t))l.call(t,r)&&u(e,r,t[r]);return e},m=(e,t)=>i(e,s(t)),f=(e,t,r,i)=>{for(var s,a=i>1?void 0:i?o(t,r):t,c=e.length-1;c>=0;c--)(s=e[c])&&(a=(i?s(t,r,a):s(a))||a);return i&&a&&n(t,r,a),a},p=(e,t,r)=>t.has(e)||d("Cannot "+r),v=(e,t,r)=>(p(e,t,"read from private field"),r?r.call(e):t.get(e)),g=(e,t,r)=>t.has(e)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),y=(e,t,r,n)=>(p(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r)},81048:function(e,t,r){r.d(t,{N:()=>i});let n;var i=(0,r(57243).iv)(n||(n=(e=>e)`:host{box-sizing:border-box}:host *,:host ::after,:host ::before{box-sizing:inherit}[hidden]{display:none!important}`))},97677:function(e,t,r){r.a(e,(async function(e,n){try{r.d(t,{Z:()=>i.A});var i=r(68783),o=(r(64699),r(15073)),s=r(21262),a=(r(81048),r(31027),r(52812),e([o,s,i]));[o,s,i]=a.then?(await a)():a,n()}catch(c){n(c)}}))},43580:function(e,t,r){r.d(t,{Z:()=>n.D});var n=r(64699);r(52812)}}]); //# sourceMappingURL=96122.3dd36ffebab6ef4b.js.map