From 9e01591cacf00c6439bd95886bf0fbf511a9a384 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 26 Nov 2019 14:10:13 -0500 Subject: [PATCH] Update service domain for blackbird from 'media_player' to 'blackbird' (#29112) * move service constants to const.py, update blackbird custom service domain * Readd bluesound services.yaml entries since it should be part of a different branch --- homeassistant/components/blackbird/const.py | 3 +++ homeassistant/components/blackbird/media_player.py | 3 +-- homeassistant/components/blackbird/services.yaml | 10 ++++++++++ homeassistant/components/media_player/services.yaml | 10 ---------- tests/components/blackbird/test_media_player.py | 3 +-- 5 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 homeassistant/components/blackbird/const.py diff --git a/homeassistant/components/blackbird/const.py b/homeassistant/components/blackbird/const.py new file mode 100644 index 00000000000..aa8d7e7d514 --- /dev/null +++ b/homeassistant/components/blackbird/const.py @@ -0,0 +1,3 @@ +"""Constants for the Monoprice Blackbird Matrix Switch component.""" +DOMAIN = "blackbird" +SERVICE_SETALLZONES = "set_all_zones" diff --git a/homeassistant/components/blackbird/media_player.py b/homeassistant/components/blackbird/media_player.py index e1aa7200c07..08efc1e6647 100644 --- a/homeassistant/components/blackbird/media_player.py +++ b/homeassistant/components/blackbird/media_player.py @@ -8,7 +8,6 @@ import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice from homeassistant.components.media_player.const import ( - DOMAIN, SUPPORT_SELECT_SOURCE, SUPPORT_TURN_OFF, SUPPORT_TURN_ON, @@ -23,6 +22,7 @@ from homeassistant.const import ( STATE_ON, ) import homeassistant.helpers.config_validation as cv +from .const import DOMAIN, SERVICE_SETALLZONES _LOGGER = logging.getLogger(__name__) @@ -39,7 +39,6 @@ CONF_SOURCES = "sources" DATA_BLACKBIRD = "blackbird" -SERVICE_SETALLZONES = "blackbird_set_all_zones" ATTR_SOURCE = "source" BLACKBIRD_SETALLZONES_SCHEMA = MEDIA_PLAYER_SCHEMA.extend( diff --git a/homeassistant/components/blackbird/services.yaml b/homeassistant/components/blackbird/services.yaml index e69de29bb2d..d541e21049d 100644 --- a/homeassistant/components/blackbird/services.yaml +++ b/homeassistant/components/blackbird/services.yaml @@ -0,0 +1,10 @@ +set_all_zones: + description: Set all Blackbird zones to a single source. + fields: + entity_id: + description: Name of any blackbird zone. + example: 'media_player.zone_1' + source: + description: Name of source to switch to. + example: 'Source 1' + diff --git a/homeassistant/components/media_player/services.yaml b/homeassistant/components/media_player/services.yaml index da229ada65c..704386ea814 100644 --- a/homeassistant/components/media_player/services.yaml +++ b/homeassistant/components/media_player/services.yaml @@ -258,16 +258,6 @@ songpal_set_sound_setting: description: Value to set. example: 'on' -blackbird_set_all_zones: - description: Set all Blackbird zones to a single source. - fields: - entity_id: - description: Name of any blackbird zone. - example: 'media_player.zone_1' - source: - description: Name of source to switch to. - example: 'Source 1' - epson_select_cmode: description: Select Color mode of Epson projector fields: diff --git a/tests/components/blackbird/test_media_player.py b/tests/components/blackbird/test_media_player.py index 34309fdbcf3..0b6eda16c15 100644 --- a/tests/components/blackbird/test_media_player.py +++ b/tests/components/blackbird/test_media_player.py @@ -5,7 +5,6 @@ import voluptuous as vol from collections import defaultdict from homeassistant.components.media_player.const import ( - DOMAIN, SUPPORT_TURN_ON, SUPPORT_TURN_OFF, SUPPORT_SELECT_SOURCE, @@ -16,9 +15,9 @@ import tests.common from homeassistant.components.blackbird.media_player import ( DATA_BLACKBIRD, PLATFORM_SCHEMA, - SERVICE_SETALLZONES, setup_platform, ) +from homeassistant.components.blackbird.const import DOMAIN, SERVICE_SETALLZONES import pytest