UNPKG

iobroker.lovelace

Version:

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

4 lines 16.7 kB
export const __rspack_esm_id=65199;export const __rspack_esm_ids=[65199];export const __webpack_modules__={90433(t,e,i){i.d(e,{Vy:()=>s,fI:()=>r,ux:()=>n});var a=i(22786),o=i(79468);function s(t,e){const i=t%54+1;return e.getPropertyValue(`--color-${i}`)}function r(t,e){const i=e.getPropertyValue(`--graph-color-${t+1}`)||s(t,e);return(0,o.RQ)(i)}const n=(0,a.A)(t=>Array.from({length:54},(e,i)=>r(i,t)),(t,e)=>t[0].getPropertyValue("--graph-color-1")===e[0].getPropertyValue("--graph-color-1")&&t[0].getPropertyValue("--color-1")===e[0].getPropertyValue("--color-1"))},69543(t,e,i){i.d(e,{J:()=>s});i(74423);var a=i(22786),o=i(46927);const s=(0,a.A)(t=>{if(t.time_format===o.Hg.language||t.time_format===o.Hg.system){const e=t.time_format===o.Hg.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return t.time_format===o.Hg.am_pm})},32172(t,e,i){i.d(e,{p:()=>a});i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);function a(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),o=e;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const t=o._transformers;o._transformers=new Map,t.forEach((t,e)=>o._transformers.set(e,t))}}else{o._transformers=new Map,o._watching=new Map;const t=o.willUpdate;o.willUpdate=function(e){t.call(this,e);const i=new Set;e.forEach((t,e)=>{const a=this._watching.get(e);void 0!==a&&a.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}o._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let e=o._watching.get(t);e||(e=new Set,o._watching.set(t,e)),e.add(i)});const s=Object.getOwnPropertyDescriptor(e,i);let r;if(void 0===s)r={get(){return this[`__transform_${a}`]},set(t){const e=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,e)},configurable:!0,enumerable:!0};else{const t=s.set;r={...s,set(e){const i=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,i),t?.call(this,e)}}}Object.defineProperty(e,i,r)}}},69093(t,e,i){i.d(e,{t:()=>o});var a=i(71727);const o=t=>(0,a.m)(t.entity_id)},82286(t,e,i){i.d(e,{$:()=>a});const a=(t,e)=>o(t.attributes,e),o=(t,e)=>0!==(t.supported_features&e)},20058(t,e,i){i.a(t,async function(t,a){try{i.d(e,{QL:()=>d,ZQ:()=>p,ZV:()=>h,ty:()=>c,x:()=>n});var o=i(74487),s=(i(74423),i(18111),i(61701),i(46927)),r=t([o]);o=(r.then?(await r)():r)[0];const n=t=>c(t.attributes),c=(t,e)=>!!t.unit_of_measurement||!!t.state_class||(e||[]).includes(t.device_class||""),l=t=>{switch(t.number_format){case s.jG.comma_decimal:return["en-US","en"];case s.jG.decimal_comma:return["de","es","it"];case s.jG.space_comma:return["fr","sv","cs"];case s.jG.quote_decimal:return["de-CH"];case s.jG.system:return;default:return t.language}},h=(t,e,i)=>d(t,e,i).map(t=>t.value).join(""),d=(t,e,i)=>{const a=e?l(e):void 0;return e?.number_format===s.jG.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||e?.number_format!==s.jG.none?[{type:"literal",value:t}]:new Intl.NumberFormat("en-US",u(t,{...i,useGrouping:!1})).formatToParts(Number(t)):new Intl.NumberFormat(a,u(t,i)).formatToParts(Number(t))},p=(t,e)=>{const i=e?.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(t?.attributes?.step))&&Number.isInteger(Number(t?.state))?{maximumFractionDigits:0}:void 0},u=(t,e)=>{const i={maximumFractionDigits:2,...e};if("string"!=typeof t)return i;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};a()}catch(t){a(t)}})},26300(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButton:()=>h});var o=i(62826),s=i(5124),r=i(22441),n=i(63672),c=i(18350),l=(i(67094),t([c]));c=(l.then?(await l)():l)[0];class h extends s.WF{render(){return s.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,n.J)(this.label)}" title="${(0,n.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,n.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?s.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:s.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}h.shadowRootOptions={mode:"open",delegatesFocus:!0},h.styles=s.AH`: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}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],h.prototype,"path",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],h.prototype,"label",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"aria-haspopup"})],h.prototype,"ariaHasPopup",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"hide-title",type:Boolean})],h.prototype,"hideTitle",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"selected",void 0),(0,o.Cg)([(0,r.MZ)()],h.prototype,"href",void 0),(0,o.Cg)([(0,r.MZ)()],h.prototype,"target",void 0),(0,o.Cg)([(0,r.MZ)()],h.prototype,"rel",void 0),(0,o.Cg)([(0,r.MZ)()],h.prototype,"download",void 0),h=(0,o.Cg)([(0,r.EM)("ha-icon-button")],h),a()}catch(t){a(t)}})},8630(t,e,i){var a=i(62826),o=i(68618),s=i(11081),r=i(22441);class n extends o.iY{}n.styles=s.R,n=(0,a.Cg)([(0,r.EM)("ha-list")],n)},2054(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(5124),s=i(22441),r=i(1087),n=i(44249),c=i(26300),l=t([c]);c=(l.then?(await l)():l)[0];const h="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class d extends o.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 o.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return o.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${h}" @click="${this._toggleMenu}"></ha-icon-button> ${t?o.qy`<div class="dot"></div>`:""} `}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,i=t.has("narrow")?t.get("narrow"):this.narrow,a=!1===e?.kioskMode&&(i||"always_hidden"===e?.dockedSidebar),o=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&a===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,n.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,r.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}d.styles=o.AH`: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,a.Cg)([(0,s.MZ)({type:Boolean})],d.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,a.Cg)([(0,s.wk)()],d.prototype,"_hasNotifications",void 0),(0,a.Cg)([(0,s.wk)()],d.prototype,"_show",void 0),d=(0,a.Cg)([(0,s.EM)("ha-menu-button")],d),e()}catch(t){e(t)}})},93367(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(35211),s=i(5124),r=i(22441),n=i(91450),c=i(69093),l=i(22792),h=i(85694),d=(i(47680),i(67094),t([h]));h=(d.then?(await d)():d)[0];class p extends s.WF{render(){const t=this.icon||this.stateObj&&this._entities?.[this.stateObj.entity_id]?.icon||this.stateObj?.attributes.icon;if(t)return s.qy`<ha-icon .icon="${t}"></ha-icon>`;if(!this.stateObj)return s.s6;if(!this._config||!this._connection||!this._entities)return this._renderFallback();const e=(0,h.fq)(this._entities,this._config.config,this._connection.connection,this.stateObj,this.stateValue).then(t=>t?s.qy`<ha-icon .icon="${t}"></ha-icon>`:this._renderFallback());return s.qy`${(0,n.T)(e)}`}_renderFallback(){const t=(0,c.t)(this.stateObj);return s.qy` <ha-svg-icon .path="${h.l[t]||h.lW}"></ha-svg-icon> `}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"stateObj",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"stateValue",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"icon",void 0),(0,a.Cg)([(0,r.wk)(),(0,o.Fg)({context:l.WF,subscribe:!0})],p.prototype,"_config",void 0),(0,a.Cg)([(0,r.wk)(),(0,o.Fg)({context:l.Wq,subscribe:!0})],p.prototype,"_connection",void 0),(0,a.Cg)([(0,r.wk)(),(0,o.Fg)({context:l.X1,subscribe:!0})],p.prototype,"_entities",void 0),p=(0,a.Cg)([(0,r.EM)("ha-state-icon")],p),e()}catch(t){e(t)}})},67094(t,e,i){i.r(e),i.d(e,{HaSvgIcon:()=>r});var a=i(62826),o=i(5124),s=i(22441);class r extends o.WF{render(){return o.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?o.JW`<path class="primary-path" d="${this.path}"></path>`:o.s6} ${this.secondaryPath?o.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:o.s6} </g> </svg>`}}r.styles=o.AH`: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,a.Cg)([(0,s.MZ)()],r.prototype,"path",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],r.prototype,"secondaryPath",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],r.prototype,"viewBox",void 0),r=(0,a.Cg)([(0,s.EM)("ha-svg-icon")],r)},27330(t,e,i){i.d(e,{L:()=>l,p:()=>c});var a=i(62826),o=i(5124),s=i(22441),r=i(6412);const n={passive:!0},c=o.AH`:host{display:block}.top-app-bar{box-sizing:border-box;color:var(--app-header-text-color,#fff);background-color:var(--app-header-background-color,var(--primary-color));position:fixed;top:0;inset-inline-end:0;width:var(--ha-top-app-bar-width,100%);z-index:4;padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right);transition:box-shadow var(--ha-animation-duration-normal) ease,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}:host([narrow]) .top-app-bar{padding-left:var(--safe-area-inset-left)}.top-app-bar.scrolled:not(.pane-header){box-shadow:var(--ha-box-shadow-s)}.row{display:flex;align-items:center;box-sizing:border-box;width:100%;height:var(--header-height);border-bottom:var(--app-header-border-bottom)}.section{display:flex;align-items:center;box-sizing:border-box;min-width:0;height:100%;padding:0 var(--ha-space-3)}#navigation{flex:1 1 auto}.section.center{flex:1 1 auto;justify-content:center;text-align:center}.section.end{flex:none;justify-content:flex-end}.title{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-normal);line-height:var(--header-height);padding-inline-start:var(--ha-space-6)}:host([narrow]) .title{padding-inline-start:var(--ha-space-2)}.top-app-bar-fixed-adjust{padding-top:calc(var(--header-height,0px) + var(--safe-area-inset-top,0px));padding-bottom:var(--safe-area-inset-bottom);padding-right:var(--safe-area-inset-right)}:host([narrow]) .top-app-bar-fixed-adjust{padding-left:var(--safe-area-inset-left)}`;class l extends o.WF{get scrollTarget(){return this._scrollTarget||window}set scrollTarget(t){const e=this.scrollTarget;this._unregisterListeners(),this._scrollTarget=t,this._updateBarPosition(),this.requestUpdate("scrollTarget",e),this.isConnected&&(this._registerListeners(),this._syncScrollState())}_isPaneHeader(){return!1}render(){return o.qy`${this._renderHeader()}${this._renderContent()}`}connectedCallback(){super.connectedCallback(),this.hasUpdated&&(this._updateBarPosition(),this._registerListeners(),this._syncScrollState())}_renderHeader(){const t=o.qy`<span class="title"> <slot name="title"></slot> </span>`,e=this._isPaneHeader();return o.qy` <header class="top-app-bar ${(0,r.H)({"pane-header":e})}"> <div class="row"> ${e?o.qy`<section class="section" id="title"> <slot name="navigationIcon"></slot> ${t} </section>`:o.s6} <section class="section" id="navigation"> ${e?o.s6:o.qy`<slot name="navigationIcon"></slot> ${this.centerTitle?o.s6:t}`} </section> ${!e&&this.centerTitle?o.qy`<section class="section center">${t}</section>`:o.s6} <section class="section end" id="actions" role="toolbar"> <slot name="actionItems"></slot> </section> </div> </header> `}_renderContent(){return o.qy`<div class="top-app-bar-fixed-adjust"> <slot></slot> </div>`}firstUpdated(t){super.firstUpdated(t),this._updateBarPosition(),this._registerListeners(),this._syncScrollState()}disconnectedCallback(){super.disconnectedCallback(),this._unregisterListeners()}_updateBarPosition(){this._barElement&&(this._barElement.style.position=this.scrollTarget===window?"":"absolute")}_registerListeners(){this.scrollTarget.addEventListener("scroll",this._syncScrollState,n)}_unregisterListeners(){this.scrollTarget.removeEventListener("scroll",this._syncScrollState)}constructor(...t){super(...t),this.narrow=!1,this.centerTitle=!1,this._syncScrollState=()=>{const t=this.scrollTarget instanceof Window?this.scrollTarget.pageYOffset:this.scrollTarget.scrollTop;this._barElement?.classList.toggle("scrolled",t>0)}}}l.styles=c,(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],l.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"center-title",type:Boolean})],l.prototype,"centerTitle",void 0),(0,a.Cg)([(0,s.P)(".top-app-bar")],l.prototype,"_barElement",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"scrollTarget",null),l=(0,a.Cg)([(0,s.EM)("ha-top-app-bar-fixed")],l)},22675(t,e,i){i.d(e,{HV:()=>s,Hh:()=>o});var a=i(23832);const o="unavailable",s="unknown",r=[o,s,"off"];(0,a.g)(r)},44249(t,e,i){i.d(e,{V:()=>a});const a=(t,e)=>{const i=new o,a=t.subscribeMessage(t=>e(i.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{a.then(t=>t?.())}};class o{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},53580(t,e,i){i.d(e,{mdiHomeAssistant:()=>a});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"}};