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

Check for existence of system mode on Honeywell thermostats #2815

Merged
merged 3 commits into from
Aug 14, 2016

Conversation

mKeRix
Copy link
Contributor

@mKeRix mKeRix commented Aug 14, 2016

Description:
Not all Honeywell thermostats have an HVAC mode (e.g. the ones commonly sold in Germany for district heating). In 0.26 the Honeywell component would fail setting up in that case, this check whether the system_mode parameter exists before it does anything with it

Related issue (if applicable): extends #2757

Checklist:

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

If code communicates with devices, web services, or a:

  • 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.

if hasattr(self.device, 'system_mode'):
return self.device.system_mode
else:
return 'undefined'
Copy link
Member

Choose a reason for hiding this comment

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

Please return None

@balloob balloob merged commit 8210d65 into home-assistant:dev Aug 14, 2016
balloob pushed a commit that referenced this pull request Aug 14, 2016
* Check for existence of system mode on Honeywell thermostats

* Return None instead of undefined

* Use getattr instead of if/else
@mKeRix mKeRix deleted the honeywell-hvac-eu-fix branch August 14, 2016 15:07
@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.

2 participants