diff --git a/.coveragerc b/.coveragerc index 20be7adbd9455f41e05d86e79d0afe65f9bcbe0a..503cd5ad761ea119a441fb03fbaa78b0a25ef5cb 100644 --- a/.coveragerc +++ b/.coveragerc @@ -83,7 +83,7 @@ omit = homeassistant/components/blinkt/light.py homeassistant/components/blockchain/sensor.py homeassistant/components/bloomsky/* - homeassistant/components/bluesound/media_player.py + homeassistant/components/bluesound/* homeassistant/components/bluetooth_le_tracker/device_tracker.py homeassistant/components/bluetooth_tracker/device_tracker.py homeassistant/components/bme280/sensor.py diff --git a/homeassistant/components/bluesound/const.py b/homeassistant/components/bluesound/const.py new file mode 100644 index 0000000000000000000000000000000000000000..af1a8e5187c2c3fe7117425394fb8f5ea789b4f7 --- /dev/null +++ b/homeassistant/components/bluesound/const.py @@ -0,0 +1,6 @@ +"""Constants for the Bluesound HiFi wireless speakers and audio integrations component.""" +DOMAIN = "bluesound" +SERVICE_CLEAR_TIMER = "clear_sleep_timer" +SERVICE_JOIN = "join" +SERVICE_SET_TIMER = "set_sleep_timer" +SERVICE_UNJOIN = "unjoin" diff --git a/homeassistant/components/bluesound/media_player.py b/homeassistant/components/bluesound/media_player.py index 7b2719c1e4e9eee7d96c7866a53192a3f1ed1004..5a9f3561dc935407c3575f0c50c8196309b78b8a 100644 --- a/homeassistant/components/bluesound/media_player.py +++ b/homeassistant/components/bluesound/media_player.py @@ -15,7 +15,6 @@ import xmltodict from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice from homeassistant.components.media_player.const import ( ATTR_MEDIA_ENQUEUE, - DOMAIN, MEDIA_TYPE_MUSIC, SUPPORT_CLEAR_PLAYLIST, SUPPORT_NEXT_TRACK, @@ -50,6 +49,13 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.event import async_track_time_interval from homeassistant.util import Throttle import homeassistant.util.dt as dt_util +from .const import ( + DOMAIN, + SERVICE_CLEAR_TIMER, + SERVICE_JOIN, + SERVICE_SET_TIMER, + SERVICE_UNJOIN, +) _LOGGER = logging.getLogger(__name__) @@ -62,10 +68,6 @@ DEFAULT_PORT = 11000 NODE_OFFLINE_CHECK_TIMEOUT = 180 NODE_RETRY_INITIATION = timedelta(minutes=3) -SERVICE_CLEAR_TIMER = "bluesound_clear_sleep_timer" -SERVICE_JOIN = "bluesound_join" -SERVICE_SET_TIMER = "bluesound_set_sleep_timer" -SERVICE_UNJOIN = "bluesound_unjoin" STATE_GROUPED = "grouped" SYNC_STATUS_INTERVAL = timedelta(minutes=5) diff --git a/homeassistant/components/bluesound/services.yaml b/homeassistant/components/bluesound/services.yaml index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6c85c77e961c2157fd2518fe062f82dc79962686 100644 --- a/homeassistant/components/bluesound/services.yaml +++ b/homeassistant/components/bluesound/services.yaml @@ -0,0 +1,30 @@ +join: + description: Group player together. + fields: + master: + description: Entity ID of the player that should become the master of the group. + example: 'media_player.bluesound_livingroom' + entity_id: + description: Name(s) of entities that will coordinate the grouping. Platform dependent. + example: 'media_player.bluesound_livingroom' + +unjoin: + description: Unjoin the player from a group. + fields: + entity_id: + description: Name(s) of entities that will be unjoined from their group. Platform dependent. + example: 'media_player.bluesound_livingroom' + +set_sleep_timer: + description: "Set a Bluesound timer. It will increase timer in steps: 15, 30, 45, 60, 90, 0" + fields: + entity_id: + description: Name(s) of entities that will have a timer set. + example: 'media_player.bluesound_livingroom' + +clear_sleep_timer: + description: Clear a Bluesound timer. + fields: + entity_id: + description: Name(s) of entities that will have the timer cleared. + example: 'media_player.bluesound_livingroom' \ No newline at end of file diff --git a/homeassistant/components/media_player/services.yaml b/homeassistant/components/media_player/services.yaml index 92aafda81cb0a47fb8b1c0168971f73cf69b9d96..da229ada65cbea00113953b1ac5d5211cb768e42 100644 --- a/homeassistant/components/media_player/services.yaml +++ b/homeassistant/components/media_player/services.yaml @@ -244,37 +244,6 @@ yamaha_enable_output: description: Boolean indicating if port should be enabled or not. example: true -bluesound_join: - description: Group player together. - fields: - master: - description: Entity ID of the player that should become the master of the group. - example: 'media_player.bluesound_livingroom' - entity_id: - description: Name(s) of entities that will coordinate the grouping. Platform dependent. - example: 'media_player.bluesound_livingroom' - -bluesound_unjoin: - description: Unjoin the player from a group. - fields: - entity_id: - description: Name(s) of entities that will be unjoined from their group. Platform dependent. - example: 'media_player.bluesound_livingroom' - -bluesound_set_sleep_timer: - description: "Set a Bluesound timer. It will increase timer in steps: 15, 30, 45, 60, 90, 0" - fields: - entity_id: - description: Name(s) of entities that will have a timer set. - example: 'media_player.bluesound_livingroom' - -bluesound_clear_sleep_timer: - description: Clear a Bluesound timer. - fields: - entity_id: - description: Name(s) of entities that will have the timer cleared. - example: 'media_player.bluesound_livingroom' - songpal_set_sound_setting: description: Change sound setting.