From d5778681900fbfac85d9edbbdb6f2718c466ed81 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Wed, 27 Nov 2019 12:13:54 -0500 Subject: [PATCH] move yamaha service to yamaha domain (#29142) --- .coveragerc | 1 - .../components/media_player/services.yaml | 50 ------------------- homeassistant/components/yamaha/const.py | 3 ++ .../components/yamaha/media_player.py | 5 +- homeassistant/components/yamaha/services.yaml | 12 +++++ 5 files changed, 17 insertions(+), 54 deletions(-) create mode 100644 homeassistant/components/yamaha/const.py diff --git a/.coveragerc b/.coveragerc index a1e7e068ed5..91b856dc6d8 100644 --- a/.coveragerc +++ b/.coveragerc @@ -790,7 +790,6 @@ omit = homeassistant/components/xmpp/notify.py homeassistant/components/xs1/* homeassistant/components/yale_smart_alarm/alarm_control_panel.py - homeassistant/components/yamaha/media_player.py homeassistant/components/yamaha_musiccast/media_player.py homeassistant/components/yandex_transport/* homeassistant/components/yeelight/* diff --git a/homeassistant/components/media_player/services.yaml b/homeassistant/components/media_player/services.yaml index 279fed37522..ad6b8a78957 100644 --- a/homeassistant/components/media_player/services.yaml +++ b/homeassistant/components/media_player/services.yaml @@ -156,53 +156,3 @@ shuffle_set: shuffle: description: True/false for enabling/disabling shuffle. example: true - -soundtouch_play_everywhere: - description: Play on all Bose Soundtouch devices. - fields: - master: - description: Name of the master entity that will coordinate the grouping. Platform dependent. It is a shortcut for creating a multi-room zone with all devices - example: 'media_player.soundtouch_home' - -soundtouch_create_zone: - description: Create a Sountouch multi-room zone. - fields: - master: - description: Name of the master entity that will coordinate the multi-room zone. Platform dependent. - example: 'media_player.soundtouch_home' - slaves: - description: Name of slaves entities to add to the new zone. - example: 'media_player.soundtouch_bedroom' - -soundtouch_add_zone_slave: - description: Add a slave to a Sountouch multi-room zone. - fields: - master: - description: Name of the master entity that is coordinating the multi-room zone. Platform dependent. - example: 'media_player.soundtouch_home' - slaves: - description: Name of slaves entities to add to the existing zone. - example: 'media_player.soundtouch_bedroom' - -soundtouch_remove_zone_slave: - description: Remove a slave from the Sounttouch multi-room zone. - fields: - master: - description: Name of the master entity that is coordinating the multi-room zone. Platform dependent. - example: 'media_player.soundtouch_home' - slaves: - description: Name of slaves entities to remove from the existing zone. - example: 'media_player.soundtouch_bedroom' - -yamaha_enable_output: - description: Enable or disable an output port - fields: - entity_id: - description: Name(s) of entites to enable/disable port on. - example: 'media_player.yamaha' - port: - description: Name of port to enable/disable. - example: 'hdmi1' - enabled: - description: Boolean indicating if port should be enabled or not. - example: true diff --git a/homeassistant/components/yamaha/const.py b/homeassistant/components/yamaha/const.py new file mode 100644 index 00000000000..e2a0c5eceea --- /dev/null +++ b/homeassistant/components/yamaha/const.py @@ -0,0 +1,3 @@ +"""Constants for the Yamaha component.""" +DOMAIN = "yamaha" +SERVICE_ENABLE_OUTPUT = "enable_output" diff --git a/homeassistant/components/yamaha/media_player.py b/homeassistant/components/yamaha/media_player.py index eabb1ef34f1..fa2c68dce88 100644 --- a/homeassistant/components/yamaha/media_player.py +++ b/homeassistant/components/yamaha/media_player.py @@ -7,7 +7,6 @@ import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( - DOMAIN, MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, @@ -34,6 +33,8 @@ from homeassistant.const import ( ) import homeassistant.helpers.config_validation as cv +from .const import DOMAIN, SERVICE_ENABLE_OUTPUT + _LOGGER = logging.getLogger(__name__) ATTR_ENABLED = "enabled" @@ -53,8 +54,6 @@ ENABLE_OUTPUT_SCHEMA = MEDIA_PLAYER_SCHEMA.extend( {vol.Required(ATTR_ENABLED): cv.boolean, vol.Required(ATTR_PORT): cv.string} ) -SERVICE_ENABLE_OUTPUT = "yamaha_enable_output" - SUPPORT_YAMAHA = ( SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE diff --git a/homeassistant/components/yamaha/services.yaml b/homeassistant/components/yamaha/services.yaml index e69de29bb2d..592a1d1342e 100644 --- a/homeassistant/components/yamaha/services.yaml +++ b/homeassistant/components/yamaha/services.yaml @@ -0,0 +1,12 @@ +enable_output: + description: Enable or disable an output port + fields: + entity_id: + description: Name(s) of entites to enable/disable port on. + example: 'media_player.yamaha' + port: + description: Name of port to enable/disable. + example: 'hdmi1' + enabled: + description: Boolean indicating if port should be enabled or not. + example: true \ No newline at end of file