Added service select_video_output and video_out attribute#18081
Added service select_video_output and video_out attribute#18081balloob merged 8 commits intohome-assistant:devfrom leothlon:dev
Conversation
| self.command('preset {}'.format(media_id)) | ||
|
|
||
|
|
||
| def select_output(self, output): |
| for device in devices: | ||
| if service.service == SERVICE_SELECT_VIDEO_OUTPUT: | ||
| device.select_output(service.data.get(ATTR_VIDEO_OUTPUT)) | ||
|
|
| """Handle for services.""" | ||
| entity_ids = service.data.get(ATTR_ENTITY_ID) | ||
| devices = [d for d in hosts if d.entity_id in entity_ids] | ||
|
|
| 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.
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)}) |
| 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, |
| vol.Required(ATTR_VIDEO_OUTPUT): vol.In(ACCEPTED_VALUES) | ||
| }) | ||
| DOMAIN = 'media_player' | ||
| SERVICE_SELECT_VIDEO_OUTPUT = 'select_video_output' |
| vol.Required(ATTR_ENTITY_ID): cv.entity_ids, | ||
| vol.Required(ATTR_VIDEO_OUTPUT): vol.In(ACCEPTED_VALUES) | ||
| }) | ||
| DOMAIN = 'media_player' |
| TIMEOUT_MESSAGE = 'Timeout waiting for response.' | ||
|
|
||
| ATTR_VIDEO_OUTPUT = 'video_output' | ||
| ACCEPTED_VALUES = ['no', 'analog', 'yes', 'out', |
There was a problem hiding this comment.
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