Skip to content

Green shade in climate history for platforms that don't support hvac_action#3787

Merged
bramkragten merged 3 commits into
home-assistant:devfrom
OnFreund:climate_shade
Sep 24, 2019
Merged

Green shade in climate history for platforms that don't support hvac_action#3787
bramkragten merged 3 commits into
home-assistant:devfrom
OnFreund:climate_shade

Conversation

@OnFreund
Copy link
Copy Markdown
Contributor

Following the discussion on green shade for platforms that don't implement hvac_action and its conclusion here, this PR implements this.

The green shade is picked up by the values in the name + " heating" and name + " cooling" columns, but I couldn't find where the shade is actually implemented, so not sure on the best way to implement for HVAC_MODE_HEAT_COOL and HVAC_MODE_AUTO. However, I think the implementation for HVAC_MODE_HEAT and HVAC_MODE_COOL should cover most cases.

@OnFreund
Copy link
Copy Markdown
Contributor Author

Also, I don't have a platform that supports hvac_action to test with, so if anyone who does can run a quick check that would be really helpful.

@iantrich
Copy link
Copy Markdown
Member

The demo climate integration does. Add the demo platform to your configuration.yaml

climate:
  - platform: demo

@OnFreund
Copy link
Copy Markdown
Contributor Author

Thanks @iantrich. I tested with hvac_action and it seems to be working correctly.

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.

@bramkragten bramkragten merged commit 38b817b into home-assistant:dev Sep 24, 2019
@OnFreund OnFreund deleted the climate_shade branch September 24, 2019 08:45
@bramkragten bramkragten mentioned this pull request Oct 2, 2019
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants