UNPKG

iobroker.lovelace

Version:

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

23 lines 19.2 kB
/*! For license information please see 5331.5ce2cd45d0af5e78.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[5331],{84446:function(e,t,o){o.d(t,{p:function(){return i},z:function(){return r}});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var a=o(71727);const r=e=>e.include_domains.length+e.include_entities.length+e.exclude_domains.length+e.exclude_entities.length===0,i=(e,t,o,r)=>{const i=new Set(e),n=new Set(t),s=new Set(o),l=new Set(r),c=i.size>0||n.size>0,d=s.size>0||l.size>0;return c||d?c&&!d?e=>n.has(e)||i.has((0,a.m)(e)):!c&&d?e=>!l.has(e)&&!s.has((0,a.m)(e)):i.size?e=>i.has((0,a.m)(e))?!l.has(e):n.has(e):s.size?e=>s.has((0,a.m)(e))?n.has(e):!l.has(e):e=>n.has(e):()=>!0}},9503:function(e,t,o){var a=o(40445),r=o(97577),i=o(5124),n=o(67576);let s,l=e=>e;class c extends r.A{get value(){var e;return null!==(e=this._value)&&void 0!==e?e:null}set value(e){this._value=e}static get styles(){return[r.A.styles,(0,i.AH)(s||(s=l`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var( --ha-checkbox-border-color, var(--ha-color-border-neutral-normal) );--wa-form-control-background-color:var( --ha-checkbox-background-color, var(--wa-form-control-background-color) );--checked-icon-color:var( --ha-checkbox-checked-icon-color, var(--wa-color-brand-on-loud) );--wa-form-control-activated-color:var( --ha-checkbox-checked-background-color, var(--ha-color-fill-primary-loud-resting) );-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var( --ha-checkbox-required-marker, var(--ha-input-required-marker, "*") );--wa-form-control-required-content-offset:var( --ha-checkbox-required-marker-offset, 0.1rem )}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var( --ha-checkbox-border-color-hover, var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud)) )}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`))]}}c=(0,a.Cg)([(0,n.EM)("ha-checkbox")],c)},85938:function(e,t,o){o(18111),o(22489),o(3362),o(46058),o(62953);var a=o(40445),r=o(5124),i=o(67576),n=o(1087);let s,l=e=>e;class c extends r.WF{updated(e){e.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?r.s6:(0,r.qy)(s||(s=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 e=this.children[0];if(!e)return;const t=(await Promise.all([o.e(85283),o.e(70322)]).then(o.bind(o,80745))).default,a=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&&(a.draggable=this.draggableSelector),this.handleSelector&&(a.handle=this.handleSelector),void 0!==this.invertSwap&&(a.invertSwap=this.invertSwap),this.group&&(a.group=this.group),this.filter&&(a.filter=this.filter),this._sortable=new t(e,a)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...e){super(...e),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=e=>{(0,n.r)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})},this._handleAdd=e=>{(0,n.r)(this,"item-added",{index:e.newIndex,data:e.item.sortableData,item:e.item})},this._handleRemove=e=>{(0,n.r)(this,"item-removed",{index:e.oldIndex})},this._handleEnd=async e=>{(0,n.r)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)},this._handleStart=()=>{(0,n.r)(this,"drag-start")},this._handleChoose=e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}}(0,a.Cg)([(0,i.MZ)({type:Boolean})],c.prototype,"disabled",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean,attribute:"no-style"})],c.prototype,"noStyle",void 0),(0,a.Cg)([(0,i.MZ)({type:String,attribute:"draggable-selector"})],c.prototype,"draggableSelector",void 0),(0,a.Cg)([(0,i.MZ)({type:String,attribute:"handle-selector"})],c.prototype,"handleSelector",void 0),(0,a.Cg)([(0,i.MZ)({type:String,attribute:"filter"})],c.prototype,"filter",void 0),(0,a.Cg)([(0,i.MZ)({type:String})],c.prototype,"group",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean,attribute:"invert-swap"})],c.prototype,"invertSwap",void 0),(0,a.Cg)([(0,i.MZ)({attribute:!1})],c.prototype,"options",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean})],c.prototype,"rollback",void 0),c=(0,a.Cg)([(0,i.EM)("ha-sortable")],c)},61037:function(e,t,o){var a=o(40445),r=o(67576),i=o(5124),n=o(14503),s=o(14782),l=o(44144);let c,d,h=e=>e;class u extends i.WF{render(){var e;return(0,i.qy)(c||(c=h` <img class="logo" alt="${0}" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> `),s.aK[this.voiceAssistantId].name,(0,l.MR)({domain:s.aK[this.voiceAssistantId].domain,type:"icon",darkOptimized:null===(e=this.hass.themes)||void 0===e?void 0:e.darkMode},this.hass.auth.data.hassUrl))}static get styles(){return[n.RF,(0,i.AH)(d||(d=h`:host{display:inline}.logo{position:relative;vertical-align:middle;height:24px}`))]}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"voiceAssistantId",void 0),u=(0,a.Cg)([(0,r.EM)("voice-assistant-brand-icon")],u)},53211:function(e,t,o){o.d(t,{Gk:function(){return r},Gq:function(){return a}});const a=e=>e.callWS({type:"cloud/alexa/entities"}),r=(e,t)=>e.callWS({type:"cloud/alexa/entities/get",entity_id:t})},71117:function(e,t,o){o.d(t,{Gu:function(){return n},Pd:function(){return v},Sb:function(){return f},Up:function(){return g},Ut:function(){return s},cn:function(){return p},dq:function(){return h},eN:function(){return d},p1:function(){return m},p7:function(){return i},q3:function(){return c},qF:function(){return y},ql:function(){return b},vO:function(){return l},yG:function(){return u}});var a=o(86518);const r=["hass"],i=e=>{let{hass:t}=e,o=(0,a.A)(e,r);return t.callApi("POST","cloud/login",o)},n=e=>e.callApi("POST","cloud/logout"),s=(e,t)=>e.callApi("POST","cloud/forgot_password",{email:t}),l=(e,t,o)=>e.callApi("POST","cloud/register",{email:t,password:o}),c=(e,t)=>e.callApi("POST","cloud/resend_confirm",{email:t}),d=e=>e.callWS({type:"cloud/status"}),h=(e,t)=>e.callWS({type:"cloud/cloudhook/create",webhook_id:t}),u=(e,t)=>e.callWS({type:"cloud/cloudhook/delete",webhook_id:t}),p=e=>e.callWS({type:"cloud/remote/connect"}),b=e=>e.callWS({type:"cloud/remote/disconnect"}),v=e=>e.callWS({type:"cloud/subscription"}),g=(e,t)=>e.callWS(Object.assign({type:"cloud/update_prefs"},t)),f=e=>e.callWS({type:"cloud/remove_data"}),m=(e,t,o)=>e.callWS({type:"cloud/google_assistant/entities/update",entity_id:t,disable_2fa:o}),y=e=>e.callApi("GET","cloud/support_package")},14782:function(e,t,o){o.d(t,{Gw:function(){return n},Ow:function(){return l},YH:function(){return i},aK:function(){return r},hB:function(){return c},ij:function(){return s}});o(18111),o(22489);var a=o(59241);const r={conversation:{domain:"assist_pipeline",name:"Assist"},"cloud.alexa":{domain:"alexa",name:"Amazon Alexa"},"cloud.google_assistant":{domain:"google_assistant",name:"Google Assistant"}},i=(e,t,o)=>e.callWS({type:"homeassistant/expose_new_entities/set",assistant:t,expose_new:o}),n=(e,t)=>e.callWS({type:"homeassistant/expose_new_entities/get",assistant:t}),s=(e,t,o,a)=>e.callWS({type:"homeassistant/expose_entity",assistants:t,entity_ids:o,should_expose:a}),l=e=>e.callWS({type:"homeassistant/expose_entity/list"}),c=(e,t)=>{const o=(0,a.Ox)(e)[t];return Object.keys(r).filter(e=>{var t;return null==o||null===(t=o.options)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.should_expose})}},56982:function(e,t,o){o.d(t,{ig:function(){return a},kz:function(){return r}});const a=e=>e.callWS({type:"cloud/google_assistant/entities"}),r=(e,t)=>e.callWS({type:"cloud/google_assistant/entities/get",entity_id:t})},66983:function(e,t,o){o.a(e,async function(e,a){try{o.r(t);o(18111),o(7588),o(62953);var r=o(40445),i=o(5124),n=o(67576),s=o(22786),l=o(14782),c=o(95341),d=e([c]);c=(d.then?(await d)():d)[0];let h,u,p=e=>e;class b extends i.WF{render(){return this.params?(0,i.qy)(h||(h=p`<entity-voice-settings .hass="${0}" .entityId="${0}" .entry="${0}" .exposed="${0}"></entity-voice-settings>`),this.hass,this.entry.entity_id,this.entry,this._calculateExposed(this.entry)):i.s6}static get styles(){return[(0,i.AH)(u||(u=p`:host{display:flex;flex-direction:column}.content{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--ha-space-6);flex:1}`))]}constructor(...e){super(...e),this._calculateExposed=(0,s.A)(e=>{const t={};return Object.keys(l.aK).forEach(o=>{var a;t[o]=null===(a=e.options)||void 0===a||null===(a=a[o])||void 0===a?void 0:a.should_expose}),t})}}(0,r.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,r.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"entry",void 0),(0,r.Cg)([(0,n.MZ)()],b.prototype,"params",void 0),b=(0,r.Cg)([(0,n.EM)("ha-more-info-view-voice-assistants")],b),a()}catch(h){a(h)}})},54706:function(e,t,o){o.d(t,{E:function(){return i}});o(74423),o(18111),o(13579),o(3362),o(62953);var a=o(40445),r=o(67576);const i=e=>{class t extends e{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then(e=>e()):e()}this.__unsubs=void 0}}updated(e){if(super.updated(e),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var e;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(e=this.hassSubscribeRequiredHostProps)&&void 0!==e&&e.some(e=>void 0===this[e])||(this.__unsubs=this.hassSubscribe())}}return(0,a.Cg)([(0,r.MZ)({attribute:!1})],t.prototype,"hass",void 0),t}},36918:function(e,t,o){o.d(t,{o:function(){return a}});const a=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},97577:function(e,t,o){o.d(t,{A:function(){return S}});o(27495),o(62953);var a=o(5124),r=o(67576),i=o(6412),n=o(63672),s=o(34514),l=o(40991),c=o(92070),d=o(49546),h=o(9395),u=o(62676),p=o(15477),b=o(31896);o(38625);let v;var g=(0,a.AH)(v||(v=(e=>e)`:host{--checked-icon-color:var(--wa-color-brand-on-loud);--checked-icon-scale:0.8;display:inline-flex;color:var(--wa-form-control-value-color);font-family:inherit;font-weight:var(--wa-form-control-value-font-weight);line-height:var(--wa-form-control-value-line-height);user-select:none;-webkit-user-select:none}[part~=control]{display:inline-flex;flex:0 0 auto;position:relative;align-items:center;justify-content:center;width:var(--wa-form-control-toggle-size);height:var(--wa-form-control-toggle-size);border-color:var(--wa-form-control-border-color);border-radius:min(calc(var(--wa-form-control-toggle-size) * .375),var(--wa-border-radius-s));border-style:var(--wa-border-style);border-width:var(--wa-form-control-border-width);background-color:var(--wa-form-control-background-color);transition:background var(--wa-transition-normal),border-color var(--wa-transition-fast),box-shadow var(--wa-transition-fast),color var(--wa-transition-fast);transition-timing-function:var(--wa-transition-easing);margin-inline-end:.5em}[part~=base]{display:flex;align-items:flex-start;position:relative;color:currentColor;vertical-align:middle;cursor:pointer}[part~=label]{display:inline}[part~=control]:has(:checked,:indeterminate){color:var(--checked-icon-color);border-color:var(--wa-form-control-activated-color);background-color:var(--wa-form-control-activated-color)}[part~=control]:has(> input:focus-visible:not(:disabled)){outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host [part~=base]:has(input:disabled){opacity:.5;cursor:not-allowed}input{position:absolute;padding:0;margin:0;height:100%;width:100%;opacity:0;pointer-events:none}[part~=icon]{display:flex;scale:var(--checked-icon-scale)}[part~=icon]::part(svg){translate:0.0009765625em}input:not(:checked,:indeterminate)+[part~=icon]{visibility:hidden}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)}`));let f,m,y,k=e=>e;var _=Object.defineProperty,w=Object.getOwnPropertyDescriptor,x=(e,t,o,a)=>{for(var r,i=a>1?void 0:a?w(t,o):t,n=e.length-1;n>=0;n--)(r=e[n])&&(i=(a?r(t,o,i):r(i))||i);return a&&i&&_(t,o,i),i};let S=class extends u.q{static get validators(){const e=a.S$?[]:[(0,d.Y)({validationProperty:"checked",validationElement:Object.assign(document.createElement("input"),{type:"checkbox",required:!0})})];return[...super.validators,...e]}get value(){var e;return null!==(e=this._value)&&void 0!==e?e:"on"}set value(e){this._value=e}handleSizeChange(){(0,l.b)(this.localName,this.size)}get checked(){var e;return this.valueHasChanged?Boolean(this._checked):null!==(e=this._checked)&&void 0!==e?e:this.defaultChecked}set checked(e){this._checked=Boolean(e),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.indeterminate=!1,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}connectedCallback(){super.connectedCallback(),this.handleDefaultCheckedChange()}handleDefaultCheckedChange(){this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked,this.input.indeterminate=this.indeterminate),this.customStates.set("checked",this.checked),this.customStates.set("indeterminate",this.indeterminate),this.updateValidity()}handleDisabledChange(){this.customStates.set("disabled",this.disabled)}willUpdate(e){super.willUpdate(e),(e.has("value")||e.has("checked")||e.has("defaultChecked"))&&this.handleValueOrCheckedChange()}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){const e=!!a.S$||this.hasSlotController.test("hint"),t=!!this.hint||!!e,o=!this.checked&&this.indeterminate,r=o?"indeterminate":"check",l=o?"indeterminate":"check";return(0,a.qy)(f||(f=k` <label part="base"> <span part="control"> <input class="input" type="checkbox" title="${0}" name="${0}" value="${0}" .indeterminate="${0}" .checked="${0}" .disabled="${0}" .required="${0}" aria-checked="${0}" aria-describedby="hint" @click="${0}"> <wa-icon part="${0}-icon icon" library="system" name="${0}"></wa-icon> </span> <slot part="label"></slot> </label> <slot id="hint" part="hint" name="hint" aria-hidden="${0}" class="${0}"> ${0} </slot> `),this.title,(0,n.J)(this.name),(0,n.J)(this._value),(0,s.V)(this.indeterminate),(0,s.V)(this.checked),this.disabled,this.required,this.indeterminate?"mixed":this.checked?"true":"false",this.handleClick,l,r,t?"false":"true",(0,i.H)({"has-slotted":t}),this.hint)}constructor(){var e;super(...arguments),this.hasSlotController=new c.X(this,"hint"),this.title="",this.name=null,this._value=null!==(e=this.getAttribute("value"))&&void 0!==e?e:null,this.size="m",this.disabled=!1,this.indeterminate=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint=""}};S.css=[p.A,b.A,g],S.shadowRootOptions=Object.assign(Object.assign({},u.q.shadowRootOptions),{},{delegatesFocus:!0}),x([(0,r.P)('input[type="checkbox"]')],S.prototype,"input",2),x([(0,r.MZ)()],S.prototype,"title",2),x([(0,r.MZ)({reflect:!0})],S.prototype,"name",2),x([(0,r.MZ)({reflect:!0})],S.prototype,"value",1),x([(0,r.MZ)({reflect:!0})],S.prototype,"size",2),x([(0,h.w)("size")],S.prototype,"handleSizeChange",1),x([(0,r.MZ)({type:Boolean})],S.prototype,"disabled",2),x([(0,r.MZ)({type:Boolean,reflect:!0})],S.prototype,"indeterminate",2),x([(0,r.MZ)({type:Boolean,attribute:!1})],S.prototype,"checked",1),x([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"checked"})],S.prototype,"defaultChecked",2),x([(0,r.MZ)({type:Boolean,reflect:!0})],S.prototype,"required",2),x([(0,r.MZ)()],S.prototype,"hint",2),x([(0,h.w)(["checked","defaultChecked"])],S.prototype,"handleDefaultCheckedChange",1),x([(0,h.w)(["checked","indeterminate"])],S.prototype,"handleStateChange",1),x([(0,h.w)("disabled")],S.prototype,"handleDisabledChange",1),S=x([(0,r.EM)("wa-checkbox")],S),null===(m=(y=S).disableWarning)||void 0===m||m.call(y,"change-in-update")},49546:function(e,t,o){o.d(t,{Y:function(){return a}});o(44114);const a=(e={})=>{let{validationElement:t,validationProperty:o}=e;t||(t=Object.assign(document.createElement("input"),{required:!0})),o||(o="value");const a={observedAttributes:["required"],message:t.validationMessage,checkValidity(e){var t;const r={message:"",isValid:!0,invalidKeys:[]};if(!(null!==(t=e.required)&&void 0!==t?t:e.hasAttribute("required")))return r;return!e[o]&&(r.message="function"==typeof a.message?a.message(e):a.message||"",r.isValid=!1,r.invalidKeys.push("valueMissing")),r}};return a}}}]);