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

Update service domain for local_file from 'camera' to 'local_file' #28890

Merged
merged 6 commits into from Nov 26, 2019

Conversation

@raman325
Copy link
Contributor

raman325 commented Nov 20, 2019

Breaking Change:

This change breaks existing service call references to the camera.local_file_update_file_path by changing the service call to local_file.update_file_path. My understanding is that because this is not a service provided by the base camera component, it should live in the domain of the local_file component instead. If that's the case, then it also makes sense to update the service name.

Description:

Update the domain and service name for camera.local_file_update_file_path. I started down this path because of #27289 and based on the introduction here and comment here, I felt this change made sense. If I am misunderstanding the intent please let me know so that I don't keep moving through these changes, as I have noticed this pattern emerging across a bunch of integrations as I commented here. Unfortunately I don't have a device to test most of these integrations.

Related issue (if applicable): Related to #27289

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#11234

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.
raman325 added 2 commits Nov 20, 2019
@MartinHjelmare MartinHjelmare added this to Needs review in Dev Nov 20, 2019
@dshokouhi

This comment has been minimized.

Copy link
Contributor

dshokouhi commented Nov 20, 2019

Check the services section in the UI and see if the drop down of entities still filters by the camera. Changing the domain may get rid of this user friendly option.

image

@raman325

This comment has been minimized.

Copy link
Contributor Author

raman325 commented Nov 21, 2019

@dshokouhi did not think about that. The end result is that there is no filter applied to the list:
image

While I agree that the camera entity filtered list is better than the unfiltered list I get when I change the domain of the service, it can still lead to bad service calls since it is not guaranteed that all camera entities are using the local_file platform. I feel like directionally moving this service to the local_file domain would lead to a better approach because the entity discovery feature could be updated to filter entities where entity platform = service domain. Where I see this being a potential challenge is when an integration supports multiple device types. In order for the entity discovery feature to work properly, it implies that an optional device_type property should exist for service definitions in services.yaml, which could then be used to find the right device_type specific entity for entity discovery.

Thoughts? I realize this is well out of scope of the PR, and I am open to closing this PR and opening a new discussion in the architecture repo or somewhere else more appropriate.

@raman325 raman325 mentioned this pull request Nov 21, 2019
17 of 53 tasks complete
@balloob

This comment has been minimized.

Copy link
Member

balloob commented Nov 26, 2019

This service should be moved. Flaws in the UI should not guide our backend decisions 👍

Copy link
Member

balloob left a comment

One minor comment, ok to merge after this!

Dev automation moved this from Needs review to Reviewer approved Nov 26, 2019
raman325 added 2 commits Nov 26, 2019
@balloob balloob merged commit 42ce5e8 into home-assistant:dev Nov 26, 2019
6 of 9 checks passed
6 of 9 checks passed
CI #20191126.50 failed
Details
CI (Tests PyTest Python36) Tests PyTest Python36 failed
Details
CI (Tests PyTest Python37) Tests PyTest Python37 failed
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
cla-bot Everyone involved has signed the CLA
Dev automation moved this from Reviewer approved to Done Nov 26, 2019
@raman325 raman325 deleted the raman325:local_file_service_domain_and_yaml_update branch Nov 26, 2019
This was referenced Nov 27, 2019
@lock lock bot locked and limited conversation to collaborators Nov 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
4 participants
You can’t perform that action at this time.