mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Fix shade for HVAC action on graph (#3380)
This commit is contained in:
parent
4f2b82d787
commit
cdfd9cea5c
@ -155,6 +155,15 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
|||||||
domain === "climate" ||
|
domain === "climate" ||
|
||||||
domain === "water_heater"
|
domain === "water_heater"
|
||||||
) {
|
) {
|
||||||
|
const isHeating =
|
||||||
|
domain === "climate"
|
||||||
|
? (state) => state.attributes.hvac_action === "heating"
|
||||||
|
: (state) => state.state === "heat";
|
||||||
|
const isCooling =
|
||||||
|
domain === "climate"
|
||||||
|
? (state) => state.attributes.hvac_action === "cooling"
|
||||||
|
: (state) => state.state === "cool";
|
||||||
|
|
||||||
// We differentiate between thermostats that have a target temperature
|
// We differentiate between thermostats that have a target temperature
|
||||||
// range versus ones that have just a target temperature
|
// range versus ones that have just a target temperature
|
||||||
|
|
||||||
@ -165,8 +174,8 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
|||||||
state.attributes.target_temp_high !==
|
state.attributes.target_temp_high !==
|
||||||
state.attributes.target_temp_low
|
state.attributes.target_temp_low
|
||||||
);
|
);
|
||||||
const hasHeat = states.states.some((state) => state.state === "heat");
|
const hasHeat = states.states.some(isHeating);
|
||||||
const hasCool = states.states.some((state) => state.state === "cool");
|
const hasCool = states.states.some(isCooling);
|
||||||
|
|
||||||
addColumn(name + " current temperature", true);
|
addColumn(name + " current temperature", true);
|
||||||
if (hasHeat) {
|
if (hasHeat) {
|
||||||
@ -192,10 +201,10 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
|||||||
const curTemp = safeParseFloat(state.attributes.current_temperature);
|
const curTemp = safeParseFloat(state.attributes.current_temperature);
|
||||||
const series = [curTemp];
|
const series = [curTemp];
|
||||||
if (hasHeat) {
|
if (hasHeat) {
|
||||||
series.push(state.state === "heat" ? curTemp : null);
|
series.push(isHeating(state) ? curTemp : null);
|
||||||
}
|
}
|
||||||
if (hasCool) {
|
if (hasCool) {
|
||||||
series.push(state.state === "cool" ? curTemp : null);
|
series.push(isCooling(state) ? curTemp : null);
|
||||||
}
|
}
|
||||||
if (hasTargetRange) {
|
if (hasTargetRange) {
|
||||||
const targetHigh = safeParseFloat(
|
const targetHigh = safeParseFloat(
|
||||||
|
@ -12,7 +12,7 @@ export type HvacMode =
|
|||||||
| "dry"
|
| "dry"
|
||||||
| "fan_only";
|
| "fan_only";
|
||||||
|
|
||||||
export type HvacAction = "off" | "Heating" | "cooling" | "drying" | "idle";
|
export type HvacAction = "off" | "heating" | "cooling" | "drying" | "idle";
|
||||||
|
|
||||||
export type ClimateEntity = HassEntityBase & {
|
export type ClimateEntity = HassEntityBase & {
|
||||||
attributes: HassEntityAttributeBase & {
|
attributes: HassEntityAttributeBase & {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user