"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[84448],{57123:function(t,e,i){var a,s,r,n,u,o=i(28430),h=i(57567),c=i(25979),l=i(12463),b=i(16472),f=(i(28706),i(15697)),m=i(358),_=i(57527),y=i(51209),d=i(49938),g=i(87882),p=i(80189),j=i(96682),O=function(t){function e(){return(0,h.A)(this,e),(0,b.A)(this,e,arguments)}return(0,l.A)(e,t),(0,c.A)(e,[{key:"render",value:function(){var t=this._computeCurrentStatus(),e=this.stateObj.state===j.Hh||this.stateObj.state===j.HV;return(0,_.qy)(a||(a=(0,o.A)(['<div class="target"> '," </div> ",""])),e?this._localizeState():(0,_.qy)(s||(s=(0,o.A)(['<span class="state-label"> '," ",' </span> <div class="unit">',"</div>"])),this._localizeState(),this.stateObj.attributes.preset_mode&&this.stateObj.attributes.preset_mode!==g.v5?(0,_.qy)(r||(r=(0,o.A)(["- ",""])),this._formatters.formatEntityAttributeValue(this.stateObj,"preset_mode")):_.s6,this._computeTarget()),t&&!e?(0,_.qy)(n||(n=(0,o.A)([' <div class="current"> ',': <div class="unit">',"</div> </div> "])),this._localize("ui.card.climate.currently"),t):_.s6)}},{key:"_computeCurrentStatus",value:function(){if(this._formatters&&this.stateObj)return null!=this.stateObj.attributes.current_temperature&&null!=this.stateObj.attributes.current_humidity?"".concat(this._formatters.formatEntityAttributeValue(this.stateObj,"current_temperature"),"/\n      ").concat(this._formatters.formatEntityAttributeValue(this.stateObj,"current_humidity")):null!=this.stateObj.attributes.current_temperature?this._formatters.formatEntityAttributeValue(this.stateObj,"current_temperature"):null!=this.stateObj.attributes.current_humidity?this._formatters.formatEntityAttributeValue(this.stateObj,"current_humidity"):void 0}},{key:"_computeTarget",value:function(){return this._formatters&&this.stateObj?null!=this.stateObj.attributes.target_temp_low&&null!=this.stateObj.attributes.target_temp_high?"".concat(this._formatters.formatEntityAttributeValue(this.stateObj,"target_temp_low"),"-").concat(this._formatters.formatEntityAttributeValue(this.stateObj,"target_temp_high")):null!=this.stateObj.attributes.temperature?this._formatters.formatEntityAttributeValue(this.stateObj,"temperature"):null!=this.stateObj.attributes.target_humidity_low&&null!=this.stateObj.attributes.target_humidity_high?"".concat(this._formatters.formatEntityAttributeValue(this.stateObj,"target_humidity_low"),"-").concat(this._formatters.formatEntityAttributeValue(this.stateObj,"target_humidity_high")):null!=this.stateObj.attributes.humidity?this._formatters.formatEntityAttributeValue(this.stateObj,"humidity"):"":""}},{key:"_localizeState",value:function(){if(this.stateObj.state===j.Hh||this.stateObj.state===j.HV)return this._localize("state.default.".concat(this.stateObj.state));var t=this._formatters.formatEntityState(this.stateObj);if(this.stateObj.attributes.hvac_action&&this.stateObj.state!==j.KF){var e=this._formatters.formatEntityAttributeValue(this.stateObj,"hvac_action");return"".concat(e," (").concat(t,")")}return t}}])}(_.WF);O.styles=(0,_.AH)(u||(u=(0,o.A)([":host{white-space:nowrap;flex-direction:column;justify-content:center;display:flex}.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{direction:ltr;display:inline-block}"]))),(0,f.Cg)([(0,y.wk)(),(0,m.Fg)({context:p.p0,subscribe:!0})],O.prototype,"_formatters",void 0),(0,f.Cg)([(0,y.wk)(),(0,d.IW)()],O.prototype,"_localize",void 0),(0,f.Cg)([(0,y.MZ)({attribute:!1})],O.prototype,"stateObj",void 0),O=(0,f.Cg)([(0,y.EM)("ha-climate-state")],O)},83139:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);var s,r,n,u=i(28430),o=i(57567),h=i(25979),c=i(12463),l=i(16472),b=(i(16280),i(15697)),f=i(57527),m=i(51209),_=(i(57123),i(72441)),y=i(59366),d=i(58178),g=t([y,d]);[y,d]=g.then?(await g)():g;var p=function(t){function e(){return(0,o.A)(this,e),(0,l.A)(this,e,arguments)}return(0,c.A)(e,t),(0,h.A)(e,[{key:"setConfig",value:function(t){if(!t||!t.entity)throw new Error("Entity must be specified");this._config=t}},{key:"shouldUpdate",value:function(t){return(0,_.LX)(this,t)}},{key:"render",value:function(){if(!this.hass||!this._config)return f.s6;var t=this.hass.states[this._config.entity];return t?(0,f.qy)(r||(r=(0,u.A)([" <hui-generic-entity-row .hass="," .config=","> <ha-climate-state .stateObj=","> </ha-climate-state> </hui-generic-entity-row> "])),this.hass,this._config,t):(0,f.qy)(s||(s=(0,u.A)([" <hui-warning .hass=","> "," </hui-warning> "])),this.hass,(0,d.j)(this.hass,this._config.entity))}}])}(f.WF);p.styles=(0,f.AH)(n||(n=(0,u.A)(["ha-climate-state{text-align:right}"]))),(0,b.Cg)([(0,m.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,b.Cg)([(0,m.wk)()],p.prototype,"_config",void 0),p=(0,b.Cg)([(0,m.EM)("hui-climate-entity-row")],p),a()}catch(j){a(j)}})}}]);
//# sourceMappingURL=84448.316967337dee9944.js.map