iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
4 lines • 16.3 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[31975],{93421:function(t,o,i){i.d(o,{IW:function(){return h},dH:function(){return l},fI:function(){return c}});i(44114),i(62953);var e=i(35211),a=i(22792),r=i(32172);const n=(t,o)=>{let i=t;for(const e of o){if(null==i)return;i=i[e]}return i},s=(t,o,i)=>{const a=(0,r.p)({transformer:function(t){return i.call(this,t)},watch:o?[o]:[]}),n=(0,e.Fg)({context:t,subscribe:!0});return(t,o)=>{a(t,o),n(t,o)}},c=t=>s(a.iN,t.entityIdPath[0],function(o){const i=n(this,t.entityIdPath);return"string"==typeof i?null==o?void 0:o[i]:void 0}),l=t=>s(a.X1,t.entityIdPath[0],function(o){const i=n(this,t.entityIdPath);return"string"==typeof i?null==o?void 0:o[i]:void 0}),h=()=>s(a.D5,void 0,({localize:t})=>t)},32172:function(t,o,i){i.d(o,{p:function(){return e}});i(16280),i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);function e(t){return(o,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const e=String(i),a=o;if(a._transformers){if(!a.hasOwnProperty("_transformers")){const t=a._transformers;a._transformers=new Map,t.forEach((t,o)=>a._transformers.set(o,t))}}else{a._transformers=new Map,a._watching=new Map;const t=a.willUpdate;a.willUpdate=function(o){t.call(this,o);const i=new Set;o.forEach((t,o)=>{const e=this._watching.get(o);void 0!==e&&e.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}a._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let o=a._watching.get(t);o||(o=new Set,a._watching.set(t,o)),o.add(i)});const r=Object.getOwnPropertyDescriptor(o,i);let n;if(void 0===r)n={get(){return this[`__transform_${e}`]},set(t){const o=this[`__transform_${e}`],i=this._transformers.get(e);this[`__transform_${e}`]=i?i.call(this,t):t,this[`__original_${e}`]=t,this.requestUpdate(e,o)},configurable:!0,enumerable:!0};else{const t=r.set;n=Object.assign(Object.assign({},r),{},{set(o){const i=this[`__transform_${e}`],a=this._transformers.get(e);this[`__transform_${e}`]=a?a.call(this,o):o,this[`__original_${e}`]=o,this.requestUpdate(e,i),null==t||t.call(this,o)}})}Object.defineProperty(o,i,n)}}},38962:function(t,o,i){i.a(t,async function(t,e){try{i.r(o);i(62953);var a=i(40445),r=i(5124),n=i(67576),s=i(6412),c=i(93421),l=i(1087),h=i(26300),d=(i(67094),t([h]));h=(d.then?(await d)():d)[0];let p,u,v,g,f=t=>t;const b="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",y={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 w extends r.WF{render(){var t;return(0,r.qy)(p||(p=f` <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,s.H)({[this.alertType]:!0}),this.title?"":"no-title",y[this.alertType],(0,s.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(u||(u=f`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(v||(v=f`<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"),b):r.s6)}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}w.styles=(0,r.AH)(g||(g=f`.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,a.Cg)([(0,n.MZ)()],w.prototype,"title",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"alert-type"})],w.prototype,"alertType",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"dismissable",void 0),(0,a.Cg)([(0,n.wk)(),(0,c.IW)()],w.prototype,"_localize",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"narrow",void 0),w=(0,a.Cg)([(0,n.EM)("ha-alert")],w),e()}catch(p){e(p)}})},90248:function(t,o,i){i.a(t,async function(t,e){try{i.r(o),i.d(o,{HaIconButtonArrowPrev:function(){return v}});i(62953);var a=i(40445),r=i(5124),n=i(67576),s=i(63091),c=i(26300),l=t([c]);c=(l.then?(await l)():l)[0];let h,d=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class v extends r.WF{render(){var t;return(0,r.qy)(h||(h=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===s.G.document.dir?u:p}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"disabled",void 0),(0,a.Cg)([(0,n.MZ)()],v.prototype,"label",void 0),(0,a.Cg)([(0,n.MZ)()],v.prototype,"href",void 0),(0,a.Cg)([(0,n.MZ)()],v.prototype,"target",void 0),(0,a.Cg)([(0,n.MZ)()],v.prototype,"rel",void 0),(0,a.Cg)([(0,n.MZ)()],v.prototype,"download",void 0),(0,a.Cg)([(0,n.wk)()],v.prototype,"_icon",void 0),v=(0,a.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],v),e()}catch(h){e(h)}})},26300:function(t,o,i){i.a(t,async function(t,e){try{i.r(o),i.d(o,{HaIconButton:function(){return g}});i(62953);var a=i(40445),r=i(5124),n=i(67576),s=i(63672),c=i(18350),l=(i(67094),t([c]));c=(l.then?(await l)():l)[0];let h,d,p,u,v=t=>t;class g extends r.WF{render(){return(0,r.qy)(h||(h=v` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,s.J)(this.label),(0,s.J)(this.hideTitle?void 0:this.label),(0,s.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,r.qy)(d||(d=v`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,r.qy)(p||(p=v`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}g.shadowRootOptions={mode:"open",delegatesFocus:!0},g.styles=(0,r.AH)(u||(u=v`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1} (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),(0,a.Cg)([(0,n.MZ)({type:String})],g.prototype,"path",void 0),(0,a.Cg)([(0,n.MZ)({type:String})],g.prototype,"label",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],g.prototype,"ariaHasPopup",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],g.prototype,"hideTitle",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],g.prototype,"selected",void 0),(0,a.Cg)([(0,n.MZ)()],g.prototype,"href",void 0),(0,a.Cg)([(0,n.MZ)()],g.prototype,"target",void 0),(0,a.Cg)([(0,n.MZ)()],g.prototype,"rel",void 0),(0,a.Cg)([(0,n.MZ)()],g.prototype,"download",void 0),g=(0,a.Cg)([(0,n.EM)("ha-icon-button")],g),e()}catch(h){e(h)}})},2054:function(t,o,i){i.a(t,async function(t,o){try{i(16280),i(62953);var e=i(40445),a=i(5124),r=i(67576),n=i(1087),s=i(44249),c=i(26300),l=t([c]);c=(l.then?(await l)():l)[0];let h,d,p,u=t=>t;const v="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class g extends a.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return a.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,a.qy)(h||(h=u` <ha-icon-button .label="${0}" .path="${0}" ="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),v,this._toggleMenu,t?(0,a.qy)(d||(d=u`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const o=t.has("hass")?t.get("hass"):this.hass,i=t.has("narrow")?t.get("narrow"):this.narrow,e=!1===(null==o?void 0:o.kioskMode)&&(i||"always_hidden"===(null==o?void 0:o.dockedSidebar)),a=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&e===a||(this._show=a||this._alwaysVisible,a?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,s.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}g.styles=(0,a.AH)(p||(p=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,e.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,e.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,e.Cg)([(0,r.wk)()],g.prototype,"_hasNotifications",void 0),(0,e.Cg)([(0,r.wk)()],g.prototype,"_show",void 0),g=(0,e.Cg)([(0,r.EM)("ha-menu-button")],g),o()}catch(h){o(h)}})},67094:function(t,o,i){i.r(o),i.d(o,{HaSvgIcon:function(){return d}});var e=i(40445),a=i(5124),r=i(67576);let n,s,c,l,h=t=>t;class d extends a.WF{render(){return(0,a.JW)(n||(n=h` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,a.JW)(s||(s=h`<path class="primary-path" d="${0}"></path>`),this.path):a.s6,this.secondaryPath?(0,a.JW)(c||(c=h`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):a.s6)}}d.styles=(0,a.AH)(l||(l=h`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,e.Cg)([(0,r.MZ)()],d.prototype,"path",void 0),(0,e.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"secondaryPath",void 0),(0,e.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"viewBox",void 0),d=(0,e.Cg)([(0,r.EM)("ha-svg-icon")],d)},44249:function(t,o,i){i.d(o,{V:function(){return e}});i(62953);const e=(t,o)=>{const i=new a,e=t.subscribeMessage(t=>o(i.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{e.then(t=>null==t?void 0:t())}};class a{processMessage(t){if("removed"===t.type)for(const o of Object.keys(t.notifications))delete this.notifications[o];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},28794:function(t,o,i){i.a(t,async function(t,e){try{i.r(o);i(62953);var a=i(40445),r=i(5124),n=i(67576),s=i(91926),c=i(90248),l=i(18350),h=i(2054),d=i(38962),p=t([c,l,h,d]);[c,l,h,d]=p.then?(await p)():p;let u,v,g,f,b,y=t=>t;class w extends r.WF{render(){var t,o;return(0,r.qy)(u||(u=y` ${0} <div class="content"> <ha-alert alert-type="error">${0}</ha-alert> <slot> <ha-button appearance="plain" size="small" ="${0}"> ${0} </ha-button> </slot> </div> `),this.toolbar?(0,r.qy)(v||(v=y`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(t=history.state)&&void 0!==t&&t.root?(0,r.qy)(g||(g=y` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,r.qy)(f||(f=y` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)):"",this.error,this._handleBack,null===(o=this.hass)||void 0===o?void 0:o.localize("ui.common.back"))}_handleBack(){(0,s.OE)()}static get styles(){return[(0,r.AH)(b||(b=y`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box} (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev{pointer-events:auto}.content{color:var(--primary-text-color);height:calc(100% - var(--header-height));display:flex;padding:16px;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}a{color:var(--primary-color)}ha-alert{margin-bottom:16px}`))]}constructor(...t){super(...t),this.toolbar=!0,this.rootnav=!1,this.narrow=!1}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"toolbar",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"rootnav",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)()],w.prototype,"error",void 0),w=(0,a.Cg)([(0,n.EM)("hass-error-screen")],w),e()}catch(u){e(u)}})}}]);