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

deCONZ - Race condition between sensor and binary_sensor platforms #32274

Merged

Conversation

Kane610
Copy link
Member

@Kane610 Kane610 commented Feb 27, 2020

Breaking change

Proposed change

When sensor platform loads and creates entities before binary_sensor platform is done no binary_sensor entities which have battery sensor entities created will be created since they already have created entries in the gateway.deconz_id dictionary. The check wasn't really necessary but not harmful either which was why I left it in, but apparently my system is much quicker than other peoples system which might be running many more integrations.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@Kane610 Kane610 self-assigned this Feb 27, 2020
@probot-home-assistant probot-home-assistant bot added integration: deconz small-pr PRs with less than 30 lines. labels Feb 27, 2020
@Kane610 Kane610 added this to the 0.106.1 milestone Feb 27, 2020
@project-bot project-bot bot added this to Needs review in Dev Feb 27, 2020
@Kane610 Kane610 changed the title deCONZ - Raise condition when sensor and binary_sensor platforms deCONZ - Raise condition between sensor and binary_sensor platforms Feb 27, 2020
@Kane610 Kane610 linked an issue Feb 27, 2020 that may be closed by this pull request
@Kane610 Kane610 changed the title deCONZ - Raise condition between sensor and binary_sensor platforms deCONZ - Race condition between sensor and binary_sensor platforms Feb 27, 2020
@Kane610 Kane610 force-pushed the deconz-fix_sensor_raise_condition branch from 7698181 to 9708ce2 Compare February 27, 2020 19:05
@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

Merging #32274 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #32274   +/-   ##
=======================================
  Coverage   94.74%   94.74%           
=======================================
  Files         772      772           
  Lines       55929    55929           
=======================================
  Hits        52991    52991           
  Misses       2938     2938
Impacted Files Coverage Δ
homeassistant/components/deconz/binary_sensor.py 98.03% <ø> (ø) ⬆️
homeassistant/components/deconz/sensor.py 96.82% <ø> (ø) ⬆️
homeassistant/components/deconz/climate.py 100% <ø> (ø) ⬆️
homeassistant/components/deconz/light.py 96.52% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0eb5ca6...9708ce2. Read the comment docs.

@Kane610 Kane610 merged commit e695bb5 into home-assistant:dev Feb 27, 2020
Dev automation moved this from Needs review to Done Feb 27, 2020
@Kane610 Kane610 deleted the deconz-fix_sensor_raise_condition branch February 27, 2020 19:48
balloob pushed a commit that referenced this pull request Feb 27, 2020
When battery sensors gets created before other platforms loading deconz sensors gets created first the other platform would not create entities related to those battery sensors
@balloob balloob mentioned this pull request Feb 27, 2020
@lock lock bot locked and limited conversation to collaborators Feb 28, 2020
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.

deCONZ integration seems broken with 0.106 Flaky Deconz test
3 participants