UNPKG

iobroker.lovelace

Version:

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

1 lines 2.91 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[33194],{54706:function(s,t,e){e.d(t,{E:function(){return n}});e(74423),e(18111),e(13579),e(3362),e(62953);var i=e(40445),a=e(67576);const n=s=>{class t extends s{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const s=this.__unsubs.pop();s instanceof Promise?s.then(s=>s()):s()}this.__unsubs=void 0}}updated(s){if(super.updated(s),s.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of s.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var s;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(s=this.hassSubscribeRequiredHostProps)&&void 0!==s&&s.some(s=>void 0===this[s])||(this.__unsubs=this.hassSubscribe())}}return(0,i.Cg)([(0,a.MZ)({attribute:!1})],t.prototype,"hass",void 0),t}},61844:function(s,t,e){e.a(s,async function(s,i){try{e.r(t),e.d(t,{HuiWaterTotalBadge:function(){return f}});e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(62953);var a=e(40445),n=e(5124),r=e(67576),o=(e(24671),e(67094),e(20058)),c=e(38114),h=e(54706),u=s([c,o]);[c,o]=u.then?(await u)():u;let d,l,b=s=>s;const _="M12,20A6,6 0 0,1 6,14C6,10 12,3.25 12,3.25C12,3.25 18,10 18,14A6,6 0 0,1 12,20Z";class f extends((0,h.E)(n.WF)){setConfig(s){this._config=s}hassSubscribe(){var s;return[(0,c.tb)(this.hass,{key:null===(s=this._config)||void 0===s?void 0:s.collection_key}).subscribe(s=>{this._data=s})]}shouldUpdate(s){if(s.has("_config")||s.has("_data"))return!0;if(s.has("hass")){const e=s.get("hass");if(!e||!this._entities.size)return!0;for(const s of this._entities){var t;if(e.states[s]!==(null===(t=this.hass)||void 0===t?void 0:t.states[s]))return!0}}return!1}render(){if(!this._config||!this._data)return n.s6;const{value:s,unit:t}=(0,c.mn)("water",this._data.prefs,this.hass.states,this._entities),e=`${(0,o.ZV)(s,this.hass.locale,{maximumFractionDigits:1})} ${t}`,i=this._config.title||this.hass.localize("ui.panel.lovelace.cards.energy.water_total_title");return(0,n.qy)(d||(d=b` <ha-badge .label="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-badge> `),i,_,e)}constructor(...s){super(...s),this._entities=new Set,this.hassSubscribeRequiredHostProps=["_config"]}}f.styles=(0,n.AH)(l||(l=b`ha-badge{--badge-color:var(--energy-water-color)}`)),(0,a.Cg)([(0,r.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,a.Cg)([(0,r.wk)()],f.prototype,"_config",void 0),(0,a.Cg)([(0,r.wk)()],f.prototype,"_data",void 0),f=(0,a.Cg)([(0,r.EM)("hui-water-total-badge")],f),i()}catch(d){i(d)}})},56434:function(s,t,e){e.d(t,{e:function(){return a}});var i=e(81977);function a(s,t,e){return(0,i.P)(s,12*t,e)}}}]);