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

Generic Thermostat: add support for climate.turn_on/climate.turn_off #16080

Conversation

aronsky
Copy link
Contributor

@aronsky aronsky commented Aug 20, 2018

Description:

Added support for turning a generic_thermostat device on and off via climate.turn_on and climate.turn_off services. This makes certain automations a lot easier to write.

Turning it on would be a bit ambiguous (and require looking up its state prior to being turned off), but luckily, it currently supports only a single operation mode in addition to OFF: either COOL or HEAT. So the async_turn_on method simply switches the operation mode to the first mode in the operation_list, which is, by definition, the only supported mode.

In the future, if support for multiple modes is added (as has been attempted before, with an AUTO mode), the logic will have to be revised.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

@awarecan
Copy link
Contributor

For the mode_auto part, please take a look #15678

Copy link
Member

@Danielhiversen Danielhiversen left a comment

Choose a reason for hiding this comment

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

LGTM

@Danielhiversen Danielhiversen merged commit b29c296 into home-assistant:dev Sep 2, 2018
@ghost ghost removed the in progress label Sep 2, 2018
@aronsky aronsky deleted the generic-thermostat/enable-turning-on-and-off branch September 3, 2018 10:25
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
…ome-assistant#16080)

* Added async_turn_on and async_turn_off implementations.

* Added turning on/off tests to generic thermostat

* style

* style

* style
@balloob balloob mentioned this pull request Sep 17, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
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.

4 participants