"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["378"],{24486:function(t,s,i){var e=i(40445),a=i(96196),r=i(77845),h=i(22675);let n,o,u,c,l,d=t=>t;class f extends a.WF{render(){const t=this._computeCurrentStatus();return(0,a.qy)(n||(n=d`<div class="target"> ${0} </div> ${0}`),(0,h.g0)(this.stateObj.state)?this._localizeState():(0,a.qy)(o||(o=d`<span class="state-label"> ${0} ${0} </span> <div class="unit">${0}</div>`),this._localizeState(),this.stateObj.attributes.mode?(0,a.qy)(u||(u=d`- ${0}`),this.hass.formatEntityAttributeValue(this.stateObj,"mode")):"",this._computeTarget()),t&&!(0,h.g0)(this.stateObj.state)?(0,a.qy)(c||(c=d`<div class="current"> ${0}: <div class="unit">${0}</div> </div>`),this.hass.localize("ui.card.climate.currently"),t):"")}_computeCurrentStatus(){if(this.hass&&this.stateObj)return null!=this.stateObj.attributes.current_humidity?`${this.hass.formatEntityAttributeValue(this.stateObj,"current_humidity")}`:void 0}_computeTarget(){return this.hass&&this.stateObj&&null!=this.stateObj.attributes.humidity?`${this.hass.formatEntityAttributeValue(this.stateObj,"humidity")}`:""}_localizeState(){if((0,h.g0)(this.stateObj.state))return this.hass.localize(`state.default.${this.stateObj.state}`);const t=this.hass.formatEntityState(this.stateObj);if(this.stateObj.attributes.action&&this.stateObj.state!==h.KF){return`${this.hass.formatEntityAttributeValue(this.stateObj,"action")} (${t})`}return t}}f.styles=(0,a.AH)(l||(l=d`:host{display:flex;flex-direction:column;justify-content:center;white-space:nowrap}.target{color:var(--primary-text-color)}.current{color:var(--secondary-text-color)}.state-label{font-weight:var(--ha-font-weight-bold)}.unit{display:inline-block;direction:ltr}`)),(0,e.Cg)([(0,r.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,e.Cg)([(0,r.MZ)({attribute:!1})],f.prototype,"stateObj",void 0),f=(0,e.Cg)([(0,r.EM)("ha-humidifier-state")],f)},53537:function(t,s,i){i.a(t,async function(t,e){try{i.r(s);i(16280);var a=i(40445),r=i(96196),h=i(77845),n=i(25240),o=(i(24486),i(784)),u=i(79757),c=i(85979),l=t([n,u,c]);[n,u,c]=l.then?(await l)():l;let d,f,b,y=t=>t;class g extends r.WF{setConfig(t){if(!t||!t.entity)throw new Error("Entity must be specified");this._config=t}shouldUpdate(t){return(0,o.LX)(this,t)}render(){if(!this.hass||!this._config)return r.s6;const t=this.hass.states[this._config.entity];return t?(0,r.qy)(f||(f=y` <hui-generic-entity-row .hass="${0}" .config="${0}"> <ha-humidifier-state .hass="${0}" .stateObj="${0}"> </ha-humidifier-state> </hui-generic-entity-row> `),this.hass,this._config,this.hass,t):(0,r.qy)(d||(d=y` <hui-warning .hass="${0}"> ${0} </hui-warning> `),this.hass,(0,c.j)(this.hass,this._config.entity))}}g.styles=(0,r.AH)(b||(b=y`ha-humidifier-state{text-align:right}`)),(0,a.Cg)([(0,h.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,a.Cg)([(0,h.wk)()],g.prototype,"_config",void 0),g=(0,a.Cg)([(0,h.EM)("hui-humidifier-entity-row")],g),e()}catch(d){e(d)}})}}]);
//# sourceMappingURL=378.9a8a4cc2324eee30.js.map