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