"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["56995"],{68971:function(t,e,s){var i,a,r,n,h,u=s(72153),o=s(44734),c=s(43080),l=s(69683),b=s(6454),y=(s(28706),s(40445)),f=s(96196),m=s(77845),_=s(38279),d=s(22675),g=function(t){function e(){return(0,o.A)(this,e),(0,l.A)(this,e,arguments)}return(0,b.A)(e,t),(0,c.A)(e,[{key:"render",value:function(){var t=this._computeCurrentStatus();return(0,f.qy)(i||(i=(0,u.A)(['<div class="target"> '," </div> ",""])),(0,d.g0)(this.stateObj.state)?this._localizeState():(0,f.qy)(a||(a=(0,u.A)(['<span class="state-label"> '," ",' </span> <div class="unit">',"</div>"])),this._localizeState(),this.stateObj.attributes.preset_mode&&this.stateObj.attributes.preset_mode!==_.v5?(0,f.qy)(r||(r=(0,u.A)(["- ",""])),this.hass.formatEntityAttributeValue(this.stateObj,"preset_mode")):f.s6,this._computeTarget()),t&&!(0,d.g0)(this.stateObj.state)?(0,f.qy)(n||(n=(0,u.A)([' <div class="current"> ',': <div class="unit">',"</div> </div> "])),this.hass.localize("ui.card.climate.currently"),t):f.s6)}},{key:"_computeCurrentStatus",value:function(){if(this.hass&&this.stateObj)return null!=this.stateObj.attributes.current_temperature&&null!=this.stateObj.attributes.current_humidity?"".concat(this.hass.formatEntityAttributeValue(this.stateObj,"current_temperature"),"/\n      ").concat(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}},{key:"_computeTarget",value:function(){return this.hass&&this.stateObj?null!=this.stateObj.attributes.target_temp_low&&null!=this.stateObj.attributes.target_temp_high?"".concat(this.hass.formatEntityAttributeValue(this.stateObj,"target_temp_low"),"-").concat(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?"".concat(this.hass.formatEntityAttributeValue(this.stateObj,"target_humidity_low"),"-").concat(this.hass.formatEntityAttributeValue(this.stateObj,"target_humidity_high")):null!=this.stateObj.attributes.humidity?this.hass.formatEntityAttributeValue(this.stateObj,"humidity"):"":""}},{key:"_localizeState",value:function(){if((0,d.g0)(this.stateObj.state))return this.hass.localize("state.default.".concat(this.stateObj.state));var t=this.hass.formatEntityState(this.stateObj);if(this.stateObj.attributes.hvac_action&&this.stateObj.state!==d.KF){var e=this.hass.formatEntityAttributeValue(this.stateObj,"hvac_action");return"".concat(e," (").concat(t,")")}return t}}])}(f.WF);g.styles=(0,f.AH)(h||(h=(0,u.A)([":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,y.Cg)([(0,m.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,y.Cg)([(0,m.MZ)({attribute:!1})],g.prototype,"stateObj",void 0),g=(0,y.Cg)([(0,m.EM)("ha-climate-state")],g)},2798:function(t,e,s){s.a(t,async function(t,i){try{s.r(e);var a,r,n,h=s(72153),u=s(44734),o=s(43080),c=s(69683),l=s(6454),b=(s(16280),s(40445)),y=s(96196),f=s(77845),m=(s(68971),s(784)),_=s(79757),d=s(85979),g=t([_]);_=(g.then?(await g)():g)[0];var j=function(t){function e(){return(0,u.A)(this,e),(0,c.A)(this,e,arguments)}return(0,l.A)(e,t),(0,o.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,m.LX)(this,t)}},{key:"render",value:function(){if(!this.hass||!this._config)return y.s6;var t=this.hass.states[this._config.entity];return t?(0,y.qy)(r||(r=(0,h.A)([' <hui-generic-entity-row .hass="','" .config="','"> <ha-climate-state .hass="','" .stateObj="','"> </ha-climate-state> </hui-generic-entity-row> '])),this.hass,this._config,this.hass,t):(0,y.qy)(a||(a=(0,h.A)([' <hui-warning .hass="','"> '," </hui-warning> "])),this.hass,(0,d.j)(this.hass,this._config.entity))}}])}(y.WF);j.styles=(0,y.AH)(n||(n=(0,h.A)(["ha-climate-state{text-align:right}"]))),(0,b.Cg)([(0,f.MZ)({attribute:!1})],j.prototype,"hass",void 0),(0,b.Cg)([(0,f.wk)()],j.prototype,"_config",void 0),j=(0,b.Cg)([(0,f.EM)("hui-climate-entity-row")],j),i()}catch(p){i(p)}})}}]);
//# sourceMappingURL=56995.9f2aafd76daafeda.js.map