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
Added service select_video_output and video_out attribute #18081
Conversation
@@ -276,6 +301,10 @@ def play_media(self, media_type, media_id, **kwargs): | |||
self.command('preset {}'.format(media_id)) | |||
|
|||
|
|||
def select_output(self, output): |
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.
too many blank lines (2)
for device in devices: | ||
if service.service == SERVICE_SELECT_VIDEO_OUTPUT: | ||
device.select_output(service.data.get(ATTR_VIDEO_OUTPUT)) | ||
|
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.
blank line contains whitespace
"""Handle for services.""" | ||
entity_ids = service.data.get(ATTR_ENTITY_ID) | ||
devices = [d for d in hosts if d.entity_id in entity_ids] | ||
|
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.
blank line contains whitespace
@@ -55,6 +55,10 @@ | |||
|
|||
TIMEOUT_MESSAGE = 'Timeout waiting for response.' | |||
|
|||
ATTR_VIDEO_OUTPUT = 'video_output' | |||
ONKYO_SELECT_OUTPUT_SCHEMA = vol.Schema({vol.Required(ATTR_ENTITY_ID): cv.entity_ids, vol.Required(ATTR_VIDEO_OUTPUT): vol.In(['no', 'analog', 'yes', 'out', 'out-sub', 'sub', 'hdbaset', 'both', 'up'])}) |
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 (202 > 79 characters)
ACCEPTED_VALUES = ['no', 'analog', 'yes', 'out', | ||
'out-sub', 'sub', 'hdbaset', 'both', 'up'] | ||
ONKYO_SELECT_OUTPUT_SCHEMA = vol.Schema({vol.Required(ATTR_ENTITY_ID): cv.entity_ids, | ||
vol.Required(ATTR_VIDEO_OUTPUT): vol.In(ACCEPTED_VALUES)}) |
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 (99 > 79 characters)
ATTR_VIDEO_OUTPUT = 'video_output' | ||
ACCEPTED_VALUES = ['no', 'analog', 'yes', 'out', | ||
'out-sub', 'sub', 'hdbaset', 'both', 'up'] | ||
ONKYO_SELECT_OUTPUT_SCHEMA = vol.Schema({vol.Required(ATTR_ENTITY_ID): cv.entity_ids, |
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 (85 > 79 characters)
vol.Required(ATTR_VIDEO_OUTPUT): vol.In(ACCEPTED_VALUES) | ||
}) | ||
DOMAIN = 'media_player' | ||
SERVICE_SELECT_VIDEO_OUTPUT = 'select_video_output' |
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.
prefix with platform name.
vol.Required(ATTR_ENTITY_ID): cv.entity_ids, | ||
vol.Required(ATTR_VIDEO_OUTPUT): vol.In(ACCEPTED_VALUES) | ||
}) | ||
DOMAIN = 'media_player' |
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.
import domain.
@@ -55,6 +56,16 @@ | |||
|
|||
TIMEOUT_MESSAGE = 'Timeout waiting for response.' | |||
|
|||
ATTR_VIDEO_OUTPUT = 'video_output' | |||
ACCEPTED_VALUES = ['no', 'analog', 'yes', 'out', |
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.
is this valid for all onkyos?
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.
Those are the accepted values according to the onkyo-eiscp library, not all of them would work on all recievers i dont think (for me "out" switches to main and "out-sub" switches to sub, "sub" switches to both. so its not totally clear what to use but rather trial and error, planning to update this in the docs when i get time).
The command would only work for recievers with more than one hdmi-out port ofc.
Other than that i wouldn't really know as i only got one reciever to test with. (onkyo-eiscp said the command is for Japanese models but i got a European one and it works fine).
Please also open a PR for the docs repo. |
PR for docs made, home-assistant/home-assistant.io#7334 |
This commit breaks my Home Assistant.
|
That's fixed in #18478. Please don't comment in merged PRs. Open an issue instead. |
Description:
Added service to change video hdmi output
service data "video_output" takes a value of:
'no', 'analog', 'yes', 'out', 'out-sub', 'sub', 'hdbaset', 'both', 'up'
Also adds attribute of "video_out" to display current output
Checklist:
tox
. Your PR cannot be merged unless tests pass