iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
10 lines • 18.3 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[23103],{93421:function(t,e,o){o.d(e,{IW:function(){return h},dH:function(){return c},fI:function(){return l}});o(44114),o(62953);var r=o(35211),i=o(22792),a=o(32172);const s=(t,e)=>{let o=t;for(const r of e){if(null==o)return;o=o[r]}return o},n=(t,e,o)=>{const i=(0,a.p)({transformer:function(t){return o.call(this,t)},watch:e?[e]:[]}),s=(0,r.Fg)({context:t,subscribe:!0});return(t,e)=>{i(t,e),s(t,e)}},l=t=>n(i.iN,t.entityIdPath[0],function(e){const o=s(this,t.entityIdPath);return"string"==typeof o?null==e?void 0:e[o]:void 0}),c=t=>n(i.X1,t.entityIdPath[0],function(e){const o=s(this,t.entityIdPath);return"string"==typeof o?null==e?void 0:e[o]:void 0}),h=()=>n(i.D5,void 0,({localize:t})=>t)},32172:function(t,e,o){o.d(e,{p:function(){return r}});o(16280),o(18111),o(7588),o(45367),o(92731),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);function r(t){return(e,o)=>{if("object"==typeof o)throw new Error("This decorator does not support this compilation type.");const r=String(o),i=e;if(i._transformers){if(!i.hasOwnProperty("_transformers")){const t=i._transformers;i._transformers=new Map,t.forEach((t,e)=>i._transformers.set(e,t))}}else{i._transformers=new Map,i._watching=new Map;const t=i.willUpdate;i.willUpdate=function(e){t.call(this,e);const o=new Set;e.forEach((t,e)=>{const r=this._watching.get(e);void 0!==r&&r.forEach(t=>o.add(t))}),o.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}i._transformers.set(o,t.transformer),t.watch&&t.watch.forEach(t=>{let e=i._watching.get(t);e||(e=new Set,i._watching.set(t,e)),e.add(o)});const a=Object.getOwnPropertyDescriptor(e,o);let s;if(void 0===a)s={get(){return this[`__transform_${r}`]},set(t){const e=this[`__transform_${r}`],o=this._transformers.get(r);this[`__transform_${r}`]=o?o.call(this,t):t,this[`__original_${r}`]=t,this.requestUpdate(r,e)},configurable:!0,enumerable:!0};else{const t=a.set;s=Object.assign(Object.assign({},a),{},{set(e){const o=this[`__transform_${r}`],i=this._transformers.get(r);this[`__transform_${r}`]=i?i.call(this,e):e,this[`__original_${r}`]=e,this.requestUpdate(r,o),null==t||t.call(this,e)}})}Object.defineProperty(e,o,s)}}},38962:function(t,e,o){o.a(t,async function(t,r){try{o.r(e);o(62953);var i=o(40445),a=o(5124),s=o(67576),n=o(6412),l=o(93421),c=o(1087),h=o(26300),d=(o(67094),t([h]));h=(d.then?(await d)():d)[0];let p,u,b,v,g=t=>t;const m="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",f={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class y extends a.WF{render(){var t;return(0,a.qy)(p||(p=g` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.H)({[this.alertType]:!0}),this.title?"":"no-title",f[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,a.qy)(u||(u=g`<div class="title">${0}</div>`),this.title):a.s6,this.dismissable?(0,a.qy)(b||(b=g`<ha-icon-button ="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),m):a.s6)}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}y.styles=(0,a.AH)(v||(v=g`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,i.Cg)([(0,s.MZ)()],y.prototype,"title",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"alert-type"})],y.prototype,"alertType",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"dismissable",void 0),(0,i.Cg)([(0,s.wk)(),(0,l.IW)()],y.prototype,"_localize",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"narrow",void 0),y=(0,i.Cg)([(0,s.EM)("ha-alert")],y),r()}catch(p){r(p)}})},3449:function(t,e,o){o(62953);var r=o(40445),i=o(5124),a=o(67576);let s,n,l=t=>t;class c extends i.WF{render(){return(0,i.qy)(s||(s=l`<slot></slot>`))}constructor(...t){super(...t),this.disabled=!1}}c.styles=(0,i.AH)(n||(n=l`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
--mdc-typography-caption-letter-spacing,
.0333333333em
);line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`)),(0,r.Cg)([(0,a.MZ)({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),c=(0,r.Cg)([(0,a.EM)("ha-input-helper-text")],c)},2846:function(t,e,o){o.d(e,{G:function(){return p},J:function(){return d}});var r=o(40445),i=o(58168),a=o(82553),s=o(5124),n=o(67576);o(54276);let l,c,h=t=>t;const d=[a.R,(0,s.AH)(l||(l=h`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`))];class p extends i.n{renderRipple(){return"text"===this.type?s.s6:(0,s.qy)(c||(c=h`<ha-ripple part="ripple" for="item" ?disabled="${0}"></ha-ripple>`),this.disabled&&"link"!==this.type)}}p.styles=d,p=(0,r.Cg)([(0,n.EM)("ha-md-list-item")],p)},85938:function(t,e,o){o(18111),o(22489),o(3362),o(46058),o(62953);var r=o(40445),i=o(5124),a=o(67576),s=o(1087);let n,l=t=>t;class c extends i.WF{updated(t){t.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}disconnectedCallback(){super.disconnectedCallback(),this._shouldBeDestroy=!0,setTimeout(()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)},1)}connectedCallback(){super.connectedCallback(),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}createRenderRoot(){return this}render(){return this.noStyle?i.s6:(0,i.qy)(n||(n=l` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:var(--ha-border-radius-sm);opacity:.4}.sortable-drag{border-radius:var(--ha-border-radius-sm);opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `))}async _createSortable(){if(this._sortable)return;const t=this.children[0];if(!t)return;const e=(await Promise.all([o.e(85283),o.e(70322)]).then(o.bind(o,80745))).default,r=Object.assign(Object.assign({scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150},this.options),{},{onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove});this.draggableSelector&&(r.draggable=this.draggableSelector),this.handleSelector&&(r.handle=this.handleSelector),void 0!==this.invertSwap&&(r.invertSwap=this.invertSwap),this.group&&(r.group=this.group),this.filter&&(r.filter=this.filter),this._sortable=new e(t,r)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...t){super(...t),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=t=>{(0,s.r)(this,"item-moved",{newIndex:t.newIndex,oldIndex:t.oldIndex})},this._handleAdd=t=>{(0,s.r)(this,"item-added",{index:t.newIndex,data:t.item.sortableData,item:t.item})},this._handleRemove=t=>{(0,s.r)(this,"item-removed",{index:t.oldIndex})},this._handleEnd=async t=>{(0,s.r)(this,"drag-end"),this.rollback&&t.item.placeholder&&(t.item.placeholder.replaceWith(t.item),delete t.item.placeholder)},this._handleStart=()=>{(0,s.r)(this,"drag-start")},this._handleChoose=t=>{this.rollback&&(t.item.placeholder=document.createComment("sort-placeholder"),t.item.after(t.item.placeholder))}}}(0,r.Cg)([(0,a.MZ)({type:Boolean})],c.prototype,"disabled",void 0),(0,r.Cg)([(0,a.MZ)({type:Boolean,attribute:"no-style"})],c.prototype,"noStyle",void 0),(0,r.Cg)([(0,a.MZ)({type:String,attribute:"draggable-selector"})],c.prototype,"draggableSelector",void 0),(0,r.Cg)([(0,a.MZ)({type:String,attribute:"handle-selector"})],c.prototype,"handleSelector",void 0),(0,r.Cg)([(0,a.MZ)({type:String,attribute:"filter"})],c.prototype,"filter",void 0),(0,r.Cg)([(0,a.MZ)({type:String})],c.prototype,"group",void 0),(0,r.Cg)([(0,a.MZ)({type:Boolean,attribute:"invert-swap"})],c.prototype,"invertSwap",void 0),(0,r.Cg)([(0,a.MZ)({attribute:!1})],c.prototype,"options",void 0),(0,r.Cg)([(0,a.MZ)({type:Boolean})],c.prototype,"rollback",void 0),c=(0,r.Cg)([(0,a.EM)("ha-sortable")],c)},59646:function(t,e,o){o.a(t,async function(t,e){try{o(62953);var r=o(40445),i=o(29344),a=o(5124),s=o(67576),n=o(88360),l=t([i]);i=(l.then?(await l)():l)[0];let c,h=t=>t;class d extends i.A{updated(t){super.updated(t),t.has("haptic")&&(this.haptic?this.addEventListener("change",this._forwardHaptic):this.removeEventListener("change",this._forwardHaptic))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",this._forwardHaptic)}static get styles(){return[i.A.styles,(0,a.AH)(c||(c=h`:host{--wa-form-control-toggle-size:var(--ha-switch-size, 24px);--wa-form-control-required-content:var(
--ha-switch-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-switch-required-marker-offset,
0.1rem
);--thumb-size:var(--ha-switch-thumb-size, 18px);--width:var(--ha-switch-width, 48px)}label{position:relative;height:max(var(--thumb-size),var(--wa-form-control-toggle-size))}label::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-width:var(--ha-switch-min-touch-size,40px);min-height:var(--ha-switch-min-touch-size,40px)}label.disabled::before{pointer-events:none}.switch{background-color:var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-resting));border-color:var(--ha-switch-border-color,var(--ha-color-border-neutral-normal))}label:not(.disabled) .input:focus-visible~.switch,label:not(.disabled):hover .switch{background-color:var(--ha-switch-background-color-hover,var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-hover)))}.checked .switch{background-color:var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-resting));border-color:var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud))}label:not(.disabled).checked .input:focus-visible~.switch,label:not(.disabled).checked:hover .switch{background-color:var(--ha-switch-checked-background-color-hover,var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-hover)));border-color:var(--ha-switch-checked-border-color-hover,var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud)))}.switch .thumb{background-color:var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal));border-color:var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal));border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);box-shadow:var(--ha-switch-thumb-box-shadow,var(--ha-box-shadow-s))}label:not(.disabled) .input:focus-visible~.switch .thumb,label:not(.disabled):hover .switch .thumb{background-color:var(--ha-switch-thumb-background-color-hover,var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal)));border-color:var(--ha-switch-thumb-border-color-hover,var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal)))}.checked .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal));border-color:var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal))}label:not(.disabled).checked .input:focus-visible~.switch .thumb,label:not(.disabled).checked:hover .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color-hover,var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal)));border-color:var(--ha-switch-checked-thumb-border-color-hover,var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal)))}label.disabled{opacity:var(--ha-switch-disabled-opacity, .3);cursor:not-allowed}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:0;outline-offset:none}label:not(.disabled) .input:focus-visible~.switch{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host(:empty) slot.label{display:none}`))]}constructor(...t){super(...t),this.haptic=!1,this._forwardHaptic=()=>{(0,n.j)(this,"light")}}}(0,r.Cg)([(0,s.MZ)({type:Boolean})],d.prototype,"haptic",void 0),d=(0,r.Cg)([(0,s.EM)("ha-switch")],d),e()}catch(c){e(c)}})},42269:function(t,e,o){o.d(e,{p:function(){return i}});var r=o(1087);const i=(t,e)=>(0,r.r)(t,"hass-more-info",e)},54706:function(t,e,o){o.d(e,{E:function(){return a}});o(74423),o(18111),o(13579),o(3362),o(62953);var r=o(40445),i=o(67576);const a=t=>{class e extends t{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){if(super.updated(t),t.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of t.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var t;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(t=this.hassSubscribeRequiredHostProps)&&void 0!==t&&t.some(t=>void 0===this[t])||(this.__unsubs=this.hassSubscribe())}}return(0,r.Cg)([(0,i.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}},50008:function(t,e,o){o.a(t,async function(t,r){try{o.r(e);o(62953);var i=o(40445),a=o(5124),s=o(67576),n=o(1087),l=o(28978),c=o(26300),h=o(72554),d=o(42269),p=o(14503),u=o(95341),b=t([c,h,u]);[c,h,u]=b.then?(await b)():b;let v,g,m=t=>t;const f="M7 3H5V9H7V3M19 3H17V13H19V3M3 13H5V21H7V13H9V11H3V13M15 7H13V3H11V7H9V9H15V7M11 21H13V11H11V21M15 15V17H17V21H19V17H21V15H15Z";class y extends a.WF{showDialog(t){this._params=t,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}_viewMoreInfo(){(0,d.p)(this,{entityId:this._params.entityId}),this.closeDialog()}render(){if(!this._params)return a.s6;const t=(0,l.u)(this.hass.states[this._params.entityId])||this.hass.localize("ui.panel.config.entities.picker.unnamed_entity");return(0,a.qy)(v||(v=m` <ha-dialog .open="${0}" header-title="${0}" ="${0}"> <ha-icon-button slot="headerActionItems" .label="${0}" .path="${0}" ="${0}"></ha-icon-button> <div> <entity-voice-settings .hass="${0}" .entityId="${0}" .entry="${0}" .exposed="${0}" -entry-updated="${0}" -entities-changed="${0}"></entity-voice-settings> </div> </ha-dialog> `),this._open,t,this._dialogClosed,this.hass.localize("ui.dialogs.voice-settings.view_entity"),f,this._viewMoreInfo,this.hass,this._params.entityId,this._params.extEntityReg,this._params.exposed,this._entityEntryUpdated,this._exposedEntitiesChanged)}_entityEntryUpdated(t){this._params.extEntityReg=t.detail}_exposedEntitiesChanged(){var t,e;null===(t=(e=this._params).exposedEntitiesChanged)||void 0===t||t.call(e)}static get styles(){return[p.RF,p.nA,(0,a.AH)(g||(g=m`ha-dialog{--dialog-content-padding:0}`))]}constructor(...t){super(...t),this._open=!1}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,s.wk)()],y.prototype,"_params",void 0),(0,i.Cg)([(0,s.wk)()],y.prototype,"_open",void 0),y=(0,i.Cg)([(0,s.EM)("dialog-voice-settings")],y),r()}catch(v){r(v)}})},36918:function(t,e,o){o.d(e,{o:function(){return r}});const r=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`}}]);