mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 17:56:46 +00:00
Green shade in climate history for platforms that don't support hvac_action
(#3787)
* Green shade in climate history for platforms that don't support HVAC_ACTION * The presence of hvac_action can change over time * Move static condition out of anon function
This commit is contained in:
parent
c59b6626f2
commit
38b817bd67
@ -155,15 +155,21 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
||||
domain === "climate" ||
|
||||
domain === "water_heater"
|
||||
) {
|
||||
const hasHvacAction = states.states.some(
|
||||
(state) => state.attributes && state.attributes.hvac_action
|
||||
);
|
||||
|
||||
const isHeating =
|
||||
domain === "climate"
|
||||
domain === "climate" && hasHvacAction
|
||||
? (state) => state.attributes.hvac_action === "heating"
|
||||
: (state) => state.state === "heat";
|
||||
const isCooling =
|
||||
domain === "climate"
|
||||
domain === "climate" && hasHvacAction
|
||||
? (state) => state.attributes.hvac_action === "cooling"
|
||||
: (state) => state.state === "cool";
|
||||
|
||||
const hasHeat = states.states.some(isHeating);
|
||||
const hasCool = states.states.some(isCooling);
|
||||
// We differentiate between thermostats that have a target temperature
|
||||
// range versus ones that have just a target temperature
|
||||
|
||||
@ -174,8 +180,6 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
||||
state.attributes.target_temp_high !==
|
||||
state.attributes.target_temp_low
|
||||
);
|
||||
const hasHeat = states.states.some(isHeating);
|
||||
const hasCool = states.states.some(isCooling);
|
||||
|
||||
addColumn(name + " current temperature", true);
|
||||
if (hasHeat) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user