Skip to content

Fix trend binary sensor and tests#22686

Merged
balloob merged 1 commit into
home-assistant:devfrom
awarecan:fix-trend-bs
Apr 3, 2019
Merged

Fix trend binary sensor and tests#22686
balloob merged 1 commit into
home-assistant:devfrom
awarecan:fix-trend-bs

Conversation

@awarecan
Copy link
Copy Markdown
Contributor

@awarecan awarecan commented Apr 3, 2019

Description:

Trend binary sensor has the capability to calculate the state base one trend line. It is time-sensitive calculation, so the sample time should be the update_time of the entity's state, not the time trend sensor received sample.

Also, the test also time-sensitive, it may become flaky since everytime I run I got different numbers. This PR changed test to control the timing. Now I get more stable result.

One flaky test result I spotted at here: https://circleci.com/gh/home-assistant/home-assistant/3728#tests/containers/1

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

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.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@ghost ghost assigned awarecan Apr 3, 2019
@ghost ghost added the in progress label Apr 3, 2019
@balloob
Copy link
Copy Markdown
Member

balloob commented Apr 3, 2019

Flaky test is homekit controller, fixed in another branch.

@balloob balloob merged commit b4fc1d7 into home-assistant:dev Apr 3, 2019
@ghost ghost removed the in progress label Apr 3, 2019
jonbeckman pushed a commit to jonbeckman/home-assistant that referenced this pull request Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants