iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 5.27 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[78490],{91263:function(t,i,n){n.a(t,async function(t,e){try{n.d(i,{M:function(){return h}});n(44114),n(18111),n(7588),n(62953);var s=n(40445),o=n(35211),a=n(67576),r=n(43574),c=n(29478),l=t([r]);r=(l.then?(await l)():l)[0];const h=t=>{class i extends t{connectedCallback(){super.connectedCallback(),this.setupConditionalListeners()}disconnectedCallback(){super.disconnectedCallback(),this.clearConditionalListeners()}willUpdate(t){super.willUpdate(t),t.has("_maxColumns")&&(this._conditionContext=Object.assign(Object.assign({},this._conditionContext),{},{max_columns:this._maxColumns}))}updated(t){var i;(super.updated(t),t.has("_maxColumns"))&&(null===(i=this._updateVisibility)||void 0===i||i.call(this))}clearConditionalListeners(){this.__listeners.forEach(t=>t()),this.__listeners=[]}addConditionalListener(t){this.__listeners.push(t)}setupConditionalListeners(t){const i=this.config||this._config,n=t||(null==i?void 0:i.visibility);n&&this.hass&&(0,r.Ep)(n,this.hass,t=>this.addConditionalListener(t),t=>{this._updateVisibility?this._updateVisibility(t):this._updateElement&&i&&this._updateElement(i)},()=>this._conditionContext)}constructor(...t){super(...t),this.__listeners=[],this._conditionContext={}}}return(0,s.Cg)([(0,a.wk)(),(0,o.Fg)({context:c.V,subscribe:!0})],i.prototype,"_maxColumns",void 0),i};e()}catch(h){e(h)}})},29478:function(t,i,n){n.d(i,{V:function(){return e}});const e=(0,n(35211).q6)("lovelace-max-columns")},37693:function(t,i,n){n.a(t,async function(t,e){try{n.d(i,{E:function(){return h}});n(49255),n(16280),n(18111),n(22489),n(62953);var s=n(40445),o=n(5124),a=n(67576),r=n(91263),c=n(14487),l=t([r,c]);[r,c]=l.then?(await l)():l;class h extends((0,r.M)(o.mN)){createRenderRoot(){return this}validateConfig(t){if(!t.conditions)throw new Error("No conditions configured");if(!Array.isArray(t.conditions))throw new Error("Conditions need to be an array");if(!(0,c.db)(t.conditions))throw new Error("Conditions are invalid");this.lastChild&&this.removeChild(this.lastChild),this._config=t}disconnectedCallback(){super.disconnectedCallback()}connectedCallback(){super.connectedCallback(),this._updateVisibility()}setupConditionalListeners(){if(!this._config||!this.hass)return;const t=this._config.conditions.filter(t=>"condition"in t);super.setupConditionalListeners(t)}update(t){super.update(t),(t.has("_element")||t.has("_config")||t.has("hass")||t.has("preview"))&&(this.clearConditionalListeners(),this.setupConditionalListeners(),this._updateVisibility())}_updateVisibility(t){if(!this._element||!this.hass||!this._config)return;this._element.preview=this.preview;const i=null!=t?t:(0,c.XH)(this._config.conditions,this.hass,this._conditionContext);this.setVisibility(i)}setVisibility(t){if(!this._element||!this.hass)return;const i=this.preview||t;this.hidden!==!i&&(this.toggleAttribute("hidden",!i),this.style.setProperty("display",i?"":"none")),i?(this._element.hass=this.hass,this._element.parentElement||this.appendChild(this._element)):this._element.parentElement&&this.removeChild(this._element)}constructor(...t){super(...t),this.preview=!1}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean})],h.prototype,"preview",void 0),(0,s.Cg)([(0,a.wk)()],h.prototype,"_config",void 0),h=(0,s.Cg)([(0,a.EM)("hui-conditional-base")],h),e()}catch(h){e(h)}})},80725:function(t,i,n){n.a(t,async function(t,e){try{n.r(i);n(16280);var s=n(40445),o=n(67576),a=n(37693),r=n(94225),c=n(1087),l=t([a,r]);[a,r]=l.then?(await l)():l;class h extends a.E{setConfig(t){if(this.validateConfig(t),!t.row)throw new Error("No row configured");this._element=(0,r.T)(t.state_color?Object.assign({state_color:!0},t.row):t.row)}setVisibility(t){const i=this.preview||t,n=this.hidden;super.setVisibility(t),n!==this.hidden&&(0,c.r)(this,"row-visibility-changed",{row:this,value:i})}}h=(0,s.Cg)([(0,o.EM)("hui-conditional-row")],h),e()}catch(h){e(h)}})},31886:function(t,i,n){n.a(t,async function(t,e){try{n.d(i,{BB:function(){return s.B}});n(38744);var s=n(88775),o=n(49232),a=n(78713),r=n(53834),c=n(35204),l=n(5806),h=t([s,o,a,r,c,l]);[s,o,a,r,c,l]=h.then?(await h)():h,e()}catch(d){e(d)}})},92913:function(t,i,n){n.d(i,{f:function(){return o}});var e=n(73420),s=n(83504);function o(t,i,n){const o=(0,s.a)(t,null==n?void 0:n.in);return isNaN(i)?(0,e.w)((null==n?void 0:n.in)||t,NaN):i?(o.setDate(o.getDate()+i),o):o}},78733:function(t,i,n){n.d(i,{z:function(){return s}});var e=n(83504);function s(t,i,n){const s=(0,e.a)(t,null==n?void 0:n.in);return s.setTime(s.getTime()+6e4*i),s}},83339:function(t,i,n){n.d(i,{b:function(){return s}});var e=n(83504);function s(t,i){return+(0,e.a)(t)-+(0,e.a)(i)}},72659:function(t,i,n){n.d(i,{d:function(){return s}});var e=n(83504);function s(t,i){return+(0,e.a)(t)>+(0,e.a)(i)}},7562:function(t,i,n){n.d(i,{Y:function(){return s}});var e=n(83504);function s(t,i){return+(0,e.a)(t)<+(0,e.a)(i)}},20687:function(t,i,n){n.d(i,{v:function(){return s}});n(26910),n(62953);var e=n(83504);function s(t,i,n){const s=+(0,e.a)(t,null==n?void 0:n.in),[o,a]=[+(0,e.a)(i.start,null==n?void 0:n.in),+(0,e.a)(i.end,null==n?void 0:n.in)].sort((t,i)=>t-i);return s>=o&&s<=a}}}]);