Register 'firetv.adb_command' service#21419
Conversation
|
should custom services really be in media_player? |
|
Until we've moved the platform to its own component, it's ok. Moving all platforms under component packages is a work in progress. New platforms should go under their own components and register platform specific services under their component. |
We're enforcing this rule now. This should be moved to a new component to register the service. One less breaking change if done later. |
|
It's only enforced for new platforms. That's at least my understanding from reading the messages. I wouldn't mind enforcing it further. |
I'm not very familiar with the planned architectural changes. However, seeing as this migration hasn't happened yet and there are plenty of component-specific services under the |
|
@MartinHjelmare, @elupus, @andrewsayre what should I do for this pull request? |
MartinHjelmare
left a comment
There was a problem hiding this comment.
I think it's a good point that we should avoid breaking changes if we can.
- Make a firetv package with an init module,
__init__.py, with only docstring. - Git move the
firetv.pymedia_player platform to that firetv package and name itmedia_player.py. - Register the service under the new
firetvdomain, from the media_player platform.
Thanks. Edit: I think I figured out the answers to the first two questions.
|
|
Simple bash script for moving #!/bin/bash
# running in: home-assistant/homeassistant/components/media_player
export PLATFORM="firetv"
mkdir -p ../$PLATFORM
if [ ! -f "../$PLATFORM/__init__.py" ]; then
# TODO: copy the docstring
touch ../$PLATFORM/__init__.py;
fi
git add ../$PLATFORM/__init__.py
git mv $PLATFORM.py ../$PLATFORM/media_player.py |
It's not clear to me what domain we consider the moved firetv media_player platform to belong to. If it's |
|
@MartinHjelmare I called it Also, I don't know why the build is failing. I don't think it's due to any changes I made in this pull request. |
|
Also, in the services tab, the "Entity" menu doesn't populate correctly. Any idea what I need to do to fix that? |
|
The build failed, but I'm pretty sure it has nothing to do with my changes. |
|
We have moved the file that contains a requirement spec. Please follow the instructions and run the script. Also update coveragerc. |
|
I looked in the logs for both of the failed tests and it doesn't look like the failures have anything to do with the Fire TV platform. |
|
I agree with registering services under the name of the integration . That is what we should do moving forward. |
|
The build passed! Any other changes needed before merging this? |
|
Thanks @MartinHjelmare for your help with this PR and the previous one, and thanks to @carstenschroeder for inspiring this change with #20673. |
Description:
Register
media_player.firetv_adb_cmdservice so that users can send custom ADB commands to their device(s).Related issue (if applicable): fixes #
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8722
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices: