-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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 vlc.py #5334
Update vlc.py #5334
Conversation
Added support for additional optional configuration arguments: to send to vlc. It is useful for special configurations of VLC. For example, I have two sound cards on my server, so I defined two vlc media players: media_player: - platform: vlc name: speaker_1 arguments: '--alsa-audio-device=hw:1,0' - platform: vlc name: speaker_2 arguments: '--alsa-audio-device=hw:0,0' This way, by specifying the corresponding entity_id, I can send the output to the desired speaker. It is also useful for TTS.
@MrMep, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Danielhiversen and @armills to be potential reviewers. |
}) | ||
|
||
|
||
# pylint: disable=unused-argument | ||
def setup_platform(hass, config, add_devices, discovery_info=None): | ||
"""Setup the vlc platform.""" | ||
add_devices([VlcDevice(config.get(CONF_NAME))]) | ||
add_devices([VlcDevice(config.get(CONF_NAME), config.get(ADDITIONAL_ARGS))]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (80 > 79 characters)
Great, thanks |
@@ -20,28 +20,31 @@ | |||
|
|||
_LOGGER = logging.getLogger(__name__) | |||
|
|||
ADDITIONAL_ARGS = 'arguments' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be renamed to CONF_ARGUMENTS
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, done!
Documentation updated, I hope I got it right! |
Added default value for "arguments"
Description:
Added support for additional optional configuration
arguments:
to send to vlc.
It is useful for special configurations of VLC.
For example, I have two sound cards on my server, so I defined two vlc media players:
This way, by specifying the corresponding entity_id, I can send the output to the desired speaker.
It is also useful for TTS.
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#1771
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass