Skip to content

Remove auto target all entity when using a blank service call#25715

Closed
rbflurry wants to merge 4 commits into
home-assistant:devfrom
rbflurry:master
Closed

Remove auto target all entity when using a blank service call#25715
rbflurry wants to merge 4 commits into
home-assistant:devfrom
rbflurry:master

Conversation

@rbflurry
Copy link
Copy Markdown
Contributor

@rbflurry rbflurry commented Aug 5, 2019

Breaking Change:

Removes the functionality to auto target all entity when using a blank service call. This has been deprecated since December 2018 and version 0.85

Description:

Related issue (if applicable): fixes #

Relates to: #19006

Pull request with documentation for home-assistant.io (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.
  • 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.

@rbflurry rbflurry requested a review from a team as a code owner August 5, 2019 18:56
@probot-home-assistant probot-home-assistant Bot added core small-pr PRs with less than 30 lines. labels Aug 5, 2019
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 5, 2019

Codecov Report

Merging #25715 into dev will decrease coverage by 1.19%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev   #25715     +/-   ##
=========================================
- Coverage   94.01%   92.82%   -1.2%     
=========================================
  Files         541      536      -5     
  Lines       41869    41057    -812     
=========================================
- Hits        39365    38110   -1255     
- Misses       2504     2947    +443
Impacted Files Coverage Δ
homeassistant/helpers/service.py 90.99% <ø> (-0.99%) ⬇️
homeassistant/helpers/entity_component.py 94.65% <100%> (-1.59%) ⬇️
homeassistant/components/deconz/light.py 65.62% <0%> (-34.38%) ⬇️
...onents/microsoft_face_identify/image_processing.py 59.32% <0%> (-33.9%) ⬇️
...tant/components/openalpr_local/image_processing.py 64.44% <0%> (-33.34%) ⬇️
...tant/components/openalpr_cloud/image_processing.py 60.31% <0%> (-33.34%) ⬇️
...mponents/microsoft_face_detect/image_processing.py 65.45% <0%> (-27.28%) ⬇️
homeassistant/components/demo/image_processing.py 78.12% <0%> (-21.88%) ⬇️
...omeassistant/components/mqtt/light/schema_basic.py 71.8% <0%> (-21.55%) ⬇️
...meassistant/components/mqtt/alarm_control_panel.py 78.1% <0%> (-21.17%) ⬇️
... and 465 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 0449132...3425a78. Read the comment docs.

ENTITY_MATCH_ALL,
)

if data_ent_id in (ENTITY_MATCH_ALL):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is a bug. you now check if data_ent_id is a valid subscring of ENTITY_MATCH_ALL

Suggested change
if data_ent_id in (ENTITY_MATCH_ALL):
if data_ent_id == ENTITY_MATCH_ALL:

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.

Looks good. Can be merged when you address formatting and probably the tests too to work with this.

Copy link
Copy Markdown
Contributor

@amelchio amelchio left a comment

Choose a reason for hiding this comment

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

This seems too simple. Instead, we should remove the warnings completely and use vol.Required(ATTR_ENTITY_ID) in affected schemas.

)
target_all_entities = True
'Not passing an entity ID to a service to target all '
'entities is not supported.', service_name, ENTITY_MATCH_ALL)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The comment above this logging statement mentions that the service_name function parameter was only used for this warning and should be removed along with it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we still want a warning? or should I drop the warning all together.

@MartinHjelmare MartinHjelmare changed the title Removes the functionality to auto target all entity when using a blank service call. Remove auto target all entity when using a blank service call Aug 9, 2019
@MartinHjelmare
Copy link
Copy Markdown
Member

@rbflurry are you planning to continue here and address the last comment?

@frenck
Copy link
Copy Markdown
Member

frenck commented Nov 20, 2019

This PR is now running stale for 3 months and therefore, going to close it.
Feel free to re-open/re-submit the PR when ready to continue to work on it.

Your contribution would be very much appreciated 👍

@frenck frenck closed this Nov 20, 2019
@lock lock Bot locked and limited conversation to collaborators Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants