Skip to content

Google assistant skip missing type#23174

Merged
balloob merged 6 commits intohome-assistant:devfrom
elupus:google_assistant_skip_missing_type
Apr 18, 2019
Merged

Google assistant skip missing type#23174
balloob merged 6 commits intohome-assistant:devfrom
elupus:google_assistant_skip_missing_type

Conversation

@elupus
Copy link
Copy Markdown
Contributor

@elupus elupus commented Apr 17, 2019

Description:

Don't sync entities that don't map to a known google type

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 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 (example).
  • [ ] New dependencies have been added to requirements in the manifest (example).
  • [ ] New dependencies are only imported inside functions that use them (example).
  • [ ] New or updated 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:

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

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

I was first thinking no, but then realized that this is the right solution 🎉

@balloob
Copy link
Copy Markdown
Member

balloob commented Apr 17, 2019

No wait, this is wrong. If there are traits that are supported, we should have a device type for it.

@balloob
Copy link
Copy Markdown
Member

balloob commented Apr 17, 2019

Alright, made a few tweaks:

  • Reorg code
  • Add SENSOR type
  • Add a check for each test to make sure there is an associated type. Since most things are added via copy/paste, that should help catch future mistakes.

@elupus elupus requested a review from a team as a code owner April 18, 2019 05:00
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2019

Codecov Report

Merging #23174 into dev will decrease coverage by 32.23%.
The diff coverage is 96.19%.

Impacted file tree graph

@@             Coverage Diff             @@
##              dev   #23174       +/-   ##
===========================================
- Coverage   94.19%   61.96%   -32.24%     
===========================================
  Files         453      454        +1     
  Lines       36915    36920        +5     
===========================================
- Hits        34772    22876    -11896     
- Misses       2143    14044    +11901
Impacted Files Coverage Δ
homeassistant/components/google_assistant/trait.py 70.65% <100%> (-25.96%) ⬇️
homeassistant/components/google_assistant/error.py 100% <100%> (ø)
...ssistant/components/google_assistant/smart_home.py 91.2% <100%> (-2.13%) ⬇️
homeassistant/components/google_assistant/const.py 100% <100%> (ø) ⬆️
...meassistant/components/google_assistant/helpers.py 96.03% <95.6%> (-3.97%) ⬇️
homeassistant/components/automation/template.py 0% <0%> (-100%) ⬇️
homeassistant/components/litejet/switch.py 0% <0%> (-100%) ⬇️
homeassistant/components/automation/state.py 0% <0%> (-100%) ⬇️
homeassistant/components/worldclock/sensor.py 0% <0%> (-100%) ⬇️
...omeassistant/components/logi_circle/config_flow.py 0% <0%> (-100%) ⬇️
... and 211 more

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 fa73b8e...27e15fa. Read the comment docs.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2019

Codecov Report

Merging #23174 into dev will increase coverage by <.01%.
The diff coverage is 96.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #23174      +/-   ##
==========================================
+ Coverage   94.19%   94.19%   +<.01%     
==========================================
  Files         453      454       +1     
  Lines       36915    36920       +5     
==========================================
+ Hits        34772    34777       +5     
  Misses       2143     2143
Impacted Files Coverage Δ
homeassistant/components/google_assistant/trait.py 96.61% <100%> (ø) ⬆️
homeassistant/components/google_assistant/error.py 100% <100%> (ø)
homeassistant/components/cloud/http_api.py 99.01% <100%> (ø) ⬆️
...ssistant/components/google_assistant/smart_home.py 91.2% <100%> (-2.13%) ⬇️
homeassistant/components/google_assistant/const.py 100% <100%> (ø) ⬆️
...meassistant/components/google_assistant/helpers.py 96.03% <95.6%> (-3.97%) ⬇️

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 fa73b8e...da79568. Read the comment docs.

@balloob balloob merged commit 4a2a130 into home-assistant:dev Apr 18, 2019
balloob pushed a commit that referenced this pull request Apr 18, 2019
* Skip entity if no device type found

* Add test for potentially skipped binary sensors

* Reorg code, add tests to ensure all exposed things have types

* Lint

* Fix tests

* Lint
@elupus elupus deleted the google_assistant_skip_missing_type branch May 2, 2019 11:04
fredrikbaberg pushed a commit to fredrikbaberg/home-assistant that referenced this pull request May 6, 2019
* Skip entity if no device type found

* Add test for potentially skipped binary sensors

* Reorg code, add tests to ensure all exposed things have types

* Lint

* Fix tests

* Lint
fredrikbaberg pushed a commit to fredrikbaberg/home-assistant that referenced this pull request May 6, 2019
* Skip entity if no device type found

* Add test for potentially skipped binary sensors

* Reorg code, add tests to ensure all exposed things have types

* Lint

* Fix tests

* Lint
fredrikbaberg pushed a commit to fredrikbaberg/home-assistant that referenced this pull request May 6, 2019
* Skip entity if no device type found

* Add test for potentially skipped binary sensors

* Reorg code, add tests to ensure all exposed things have types

* Lint

* Fix tests

* Lint
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.

4 participants