mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Don't disable thermostat when state is unknown (#5720)
This commit is contained in:
parent
786da25b9f
commit
bc68e20041
@ -24,7 +24,7 @@ import {
|
|||||||
compareClimateHvacModes,
|
compareClimateHvacModes,
|
||||||
HvacMode,
|
HvacMode,
|
||||||
} from "../../../data/climate";
|
} from "../../../data/climate";
|
||||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
import { UNAVAILABLE } from "../../../data/entity";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { actionHandler } from "../common/directives/action-handler-directive";
|
import { actionHandler } from "../common/directives/action-handler-directive";
|
||||||
import { findEntities } from "../common/find-entites";
|
import { findEntities } from "../common/find-entites";
|
||||||
@ -125,7 +125,8 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
|
|||||||
? stateObj.attributes.temperature
|
? stateObj.attributes.temperature
|
||||||
: stateObj.attributes.min_temp;
|
: stateObj.attributes.min_temp;
|
||||||
|
|
||||||
const slider = UNAVAILABLE_STATES.includes(stateObj.state)
|
const slider =
|
||||||
|
stateObj.state === UNAVAILABLE
|
||||||
? html` <round-slider disabled="true"></round-slider> `
|
? html` <round-slider disabled="true"></round-slider> `
|
||||||
: html`
|
: html`
|
||||||
<round-slider
|
<round-slider
|
||||||
@ -322,7 +323,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _getSetTemp(stateObj: HassEntity) {
|
private _getSetTemp(stateObj: HassEntity) {
|
||||||
if (UNAVAILABLE_STATES.includes(stateObj.state)) {
|
if (stateObj.state === UNAVAILABLE) {
|
||||||
return this.hass!.localize("state.default.unavailable");
|
return this.hass!.localize("state.default.unavailable");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user