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 set fan_min_on_time thermostat service #2159

Merged
merged 1 commit into from
Jun 10, 2016
Merged

add set fan_min_on_time thermostat service #2159

merged 1 commit into from
Jun 10, 2016

Conversation

chilicheech
Copy link
Contributor

@chilicheech chilicheech commented May 24, 2016

Description:

Related issue (if applicable): #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#

Example entry for configuration.yaml (if applicable):

Checklist:

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

If code communicates with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

This is to create a service that allows you to set the minimum fan run time per hour as per ecobee's api: https://www.ecobee.com/home/developer/api/documentation/v1/objects/Settings.shtml , under fanMinOnTime. The nest seems to have similar functionality but I wasn't able to nail it down. Wasn't sure how to add a thermostat service just to the ecobee component so I added it to the thermostat component. Any feedback is appreciated.

Still waiting on nkgilley/python-ecobee-api#6 to be merged before updating the components/ecobee.py requirements. Also trying to determine what documentation needs to be updated.

Want to get this PR out there to get some feedback on the added functionality before updating the documentation.

@@ -21,14 +21,15 @@ class DemoThermostat(ThermostatDevice):
"""Representation of a demo thermostat."""

def __init__(self, name, target_temperature, unit_of_measurement,
away, current_temperature, is_fan_on):
away, current_temperature, is_fan_on, fan_min_on_time = None):

Choose a reason for hiding this comment

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

farcy v1.1

  • 71: E251 unexpected spaces around keyword / parameter equals
  • 73: E251 unexpected spaces around keyword / parameter equals

@balloob
Copy link
Member

balloob commented May 25, 2016

I wonder if this is a common service that all thermostats should have or that this is something that we should only add to the ecobee. I'm leaning to the latter.

@chilicheech
Copy link
Contributor Author

@balloob I agree with you. I just couldn't figure out how to expose that service just on the ecobee thermostat. Some guidance would be appreciated :)

@@ -37,6 +38,7 @@
ATTR_CURRENT_TEMPERATURE = "current_temperature"
ATTR_AWAY_MODE = "away_mode"
ATTR_FAN = "fan"
ATTR_FAN_MIN_ON_TIME = "minutes"
Copy link
Member

@MartinHjelmare MartinHjelmare Jun 5, 2016

Choose a reason for hiding this comment

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

This should have the same value as the key for fan_min_on_time in the state attributes for the entity that have this attribute, to make it intuitive how to call the service.

@MartinHjelmare
Copy link
Member

Since this new service modifies a state attribute you should update the dict in the state helper to support scenes.
https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/helpers/state.py#L39-L55

@chilicheech
Copy link
Contributor Author

chilicheech commented Jun 9, 2016

@balloob and @MartinHjelmare can you please review this again. I've made it so this service is exposed only to the ecobee thermostat and I updated the dictionary accordingly.

Cheers,

add_devices(devices)

def fan_min_on_time_set_service(service):
"""Set temperature on the target thermostats."""
Copy link
Member

Choose a reason for hiding this comment

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

Update the docstring. Also consider changing the name of the serivce function to set_fan_min_on_time_service.

@MartinHjelmare
Copy link
Member

One minor comment. Otherwise, this looks good to me.

@balloob
Copy link
Member

balloob commented Jun 10, 2016

Looks good! 🐬

@balloob balloob merged commit 02f342b into home-assistant:dev Jun 10, 2016
@chilicheech chilicheech deleted the fan_min_on_time branch June 10, 2016 16:17
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants