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

Fix for ecobee unknown sensor state #27542

Merged
merged 1 commit into from Oct 12, 2019

Conversation

marthoc
Copy link
Contributor

@marthoc marthoc commented Oct 12, 2019

Description:

The sensor platform was not catching all possible return values from the ecobee API for processing, resulting in the issue which this PR fixes. Now also catch the returned value "unknown". Also rewrote the async_update method to add guard clauses for greater efficiency in returning the state value.

Should be considered for a point release.

Related issue (if applicable): fixes #27489

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.

@probot-home-assistant probot-home-assistant bot added integration: ecobee small-pr PRs with less than 30 lines. labels Oct 12, 2019
@project-bot project-bot bot added this to Needs review in Dev Oct 12, 2019
@balloob balloob added this to the 0.100.2 milestone Oct 12, 2019
@@ -112,7 +112,7 @@ def device_class(self):
@property
def state(self):
"""Return the state of the sensor."""
if self._state in [ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN]:
if self._state in [ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN, "unknown"]:
Copy link
Member

Choose a reason for hiding this comment

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

Should this become part of PYECOBEE ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sure it should. There are a bunch of additions to pyecobee I want to make when the dust has settled on the changes in HA.

Dev automation moved this from Needs review to Reviewer approved Oct 12, 2019
@balloob balloob merged commit 6c947f5 into home-assistant:dev Oct 12, 2019
Dev automation moved this from Reviewer approved to Done Oct 12, 2019
@marthoc marthoc deleted the fix-ecobee-sensor-unknown-state branch October 12, 2019 20:21
balloob pushed a commit that referenced this pull request Oct 13, 2019
@balloob balloob mentioned this pull request Oct 13, 2019
@lock lock bot locked and limited conversation to collaborators Oct 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

Ecobee Issues in 0.100.1
3 participants