Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
444df5b0
Commit
444df5b0
authored
6 years ago
by
Joshi
Committed by
Fabian Affolter
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add support for sound_mode for Yamaha rxv media_player (#16352)
parent
b31890c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/media_player/yamaha.py
+21
-2
21 additions, 2 deletions
homeassistant/components/media_player/yamaha.py
with
21 additions
and
2 deletions
homeassistant/components/media_player/yamaha.py
+
21
−
2
View file @
444df5b0
...
...
@@ -14,7 +14,7 @@ from homeassistant.components.media_player import (
SUPPORT_NEXT_TRACK
,
SUPPORT_PAUSE
,
SUPPORT_PLAY
,
SUPPORT_PLAY_MEDIA
,
SUPPORT_PREVIOUS_TRACK
,
SUPPORT_SELECT_SOURCE
,
SUPPORT_STOP
,
SUPPORT_TURN_OFF
,
SUPPORT_TURN_ON
,
SUPPORT_VOLUME_MUTE
,
SUPPORT_VOLUME_SET
,
MediaPlayerDevice
)
SUPPORT_SELECT_SOUND_MODE
,
MediaPlayerDevice
)
from
homeassistant.const
import
(
ATTR_ENTITY_ID
,
CONF_HOST
,
CONF_NAME
,
STATE_IDLE
,
STATE_OFF
,
STATE_ON
,
STATE_PLAYING
)
...
...
@@ -43,7 +43,8 @@ ENABLE_OUTPUT_SCHEMA = MEDIA_PLAYER_SCHEMA.extend({
SERVICE_ENABLE_OUTPUT
=
'
yamaha_enable_output
'
SUPPORT_YAMAHA
=
SUPPORT_VOLUME_SET
|
SUPPORT_VOLUME_MUTE
|
\
SUPPORT_TURN_ON
|
SUPPORT_TURN_OFF
|
SUPPORT_SELECT_SOURCE
|
SUPPORT_PLAY
SUPPORT_TURN_ON
|
SUPPORT_TURN_OFF
|
SUPPORT_SELECT_SOURCE
|
SUPPORT_PLAY
\
|
SUPPORT_SELECT_SOUND_MODE
PLATFORM_SCHEMA
=
PLATFORM_SCHEMA
.
extend
({
vol
.
Optional
(
CONF_NAME
,
default
=
DEFAULT_NAME
):
cv
.
string
,
...
...
@@ -140,6 +141,8 @@ class YamahaDevice(MediaPlayerDevice):
self
.
_volume
=
0
self
.
_pwstate
=
STATE_OFF
self
.
_current_source
=
None
self
.
_sound_mode
=
None
self
.
_sound_mode_list
=
None
self
.
_source_list
=
None
self
.
_source_ignore
=
source_ignore
or
[]
self
.
_source_names
=
source_names
or
{}
...
...
@@ -181,6 +184,8 @@ class YamahaDevice(MediaPlayerDevice):
self
.
_playback_support
=
self
.
receiver
.
get_playback_support
()
self
.
_is_playback_supported
=
self
.
receiver
.
is_playback_supported
(
self
.
_current_source
)
self
.
_sound_mode
=
self
.
receiver
.
surround_program
self
.
_sound_mode_list
=
self
.
receiver
.
surround_programs
()
def
build_source_list
(
self
):
"""
Build the source list.
"""
...
...
@@ -222,6 +227,16 @@ class YamahaDevice(MediaPlayerDevice):
"""
Return the current input source.
"""
return
self
.
_current_source
@property
def
sound_mode
(
self
):
"""
Return the current sound mode.
"""
return
self
.
_sound_mode
@property
def
sound_mode_list
(
self
):
"""
Return the current sound mode.
"""
return
self
.
_sound_mode_list
@property
def
source_list
(
self
):
"""
List of available input sources.
"""
...
...
@@ -330,6 +345,10 @@ class YamahaDevice(MediaPlayerDevice):
"""
Enable or disable an output port..
"""
self
.
receiver
.
enable_output
(
port
,
enabled
)
def
select_sound_mode
(
self
,
sound_mode
):
"""
Set Sound Mode for Receiver..
"""
self
.
receiver
.
surround_program
=
sound_mode
@property
def
media_artist
(
self
):
"""
Artist of current playing media.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment