Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/components/state-history-chart-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
domain === "climate" ||
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";
const isHeating = (state) =>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we're no longer consistent but could change on a per-state basis. I think that we should go through all the states and see if any has an hvac action. We should calculate similarly to how we calculate hasTargetRange

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know the presence of hvac_action can change over time, but the code now supports it. It's only accounted for within the given timeframe, but I think that's as good as it gets, unless the platform has some way of signaling that hvac_action might be present.

domain === "climate" && state.attributes.hvac_action
? state.attributes.hvac_action === "heating"
: state.state === "heat";
const isCooling = (state) =>
domain === "climate" && state.attributes.hvac_action
? state.attributes.hvac_action === "cooling"
: state.state === "cool";

// We differentiate between thermostats that have a target temperature
// range versus ones that have just a target temperature
Expand Down