Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add turn_on method to ecobee climate platform #27103

Merged
merged 7 commits into from Oct 5, 2019

Conversation

@marthoc
Copy link
Contributor

marthoc commented Oct 1, 2019

Breaking Change:

Previously, calling climate.turn_on would cause the ecobee thermostat to turn on in heat mode, regardless of the mode when the thermostat was turned off. Now, the thermostat will turn on to the last "active" HVAC mode (i.e. "heat", "cool", or "auto") (or, if the thermostat was "off" when Home Assistant started, to "auto").

Description:

With no turn_on method in the ecobee climate platform, climate.turn_on was causing the ecobee thermostat to always turn on in "heat" mode (as a result of using the "fake" turn on in async_turn_on from the climate entity class). This PR adds a variable (self._last_active_hvac_mode) to track the last "active" (i.e. non-off) HVAC mode, and updates it in async_update with the latest non-off state retrieved from the ecobee API. And, the turn_on method sets the HVAC mode to the value contained in self._last_active_hvac_mode, which should be more intuitive for users.

Related issue (if applicable): fixes #27091

Pull request with documentation for home-assistant.io (if applicable): N/A

Example entry for configuration.yaml (if applicable):

N/A

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
marthoc added 3 commits Oct 1, 2019
marthoc added 3 commits Oct 1, 2019
@frenck frenck added the Hacktoberfest label Oct 2, 2019
Dev automation moved this from Needs review to Reviewer approved Oct 3, 2019
@balloob
balloob approved these changes Oct 3, 2019
Copy link
Member

balloob left a comment

Looks great! 1 tiny comment.

homeassistant/components/ecobee/climate.py Outdated Show resolved Hide resolved
@marthoc

This comment has been minimized.

Copy link
Contributor Author

marthoc commented Oct 4, 2019

Ready to go!

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Oct 5, 2019

🎉 🎉 🎉 🎉

@balloob balloob merged commit 2e49303 into home-assistant:dev Oct 5, 2019
11 checks passed
11 checks passed
CI Build #20191004.12 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected.
Details
codecov/project 94.28% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Oct 5, 2019
@balloob

This comment has been minimized.

Copy link
Member

balloob commented Oct 5, 2019

Actually thinking now (I know, maybe a little too late), shouldn't we make this part of the default turn_on command handling, for all climate entities ?

@marthoc

This comment has been minimized.

Copy link
Contributor Author

marthoc commented Oct 5, 2019

@balloob you’re probably right... I’ll take a look!

@MarshallCS

This comment has been minimized.

Copy link

MarshallCS commented Oct 5, 2019

Thank you very much for working on this!

@lock lock bot locked and limited conversation to collaborators Oct 6, 2019
@marthoc marthoc deleted the marthoc:ecobee-add-turn-on branch Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
5 participants
You can’t perform that action at this time.