diff --git a/.coveragerc b/.coveragerc index e859e05f6ee..73b203a181a 100644 --- a/.coveragerc +++ b/.coveragerc @@ -109,7 +109,7 @@ omit = homeassistant/components/cast/* homeassistant/components/cert_expiry/sensor.py homeassistant/components/cert_expiry/helper.py - homeassistant/components/channels/media_player.py + homeassistant/components/channels/* homeassistant/components/cisco_ios/device_tracker.py homeassistant/components/cisco_mobility_express/device_tracker.py homeassistant/components/cisco_webex_teams/notify.py diff --git a/homeassistant/components/channels/const.py b/homeassistant/components/channels/const.py new file mode 100644 index 00000000000..5ae7fdebb0b --- /dev/null +++ b/homeassistant/components/channels/const.py @@ -0,0 +1,5 @@ +"""Constants for the Channels component.""" +DOMAIN = "channels" +SERVICE_SEEK_FORWARD = "seek_forward" +SERVICE_SEEK_BACKWARD = "seek_backward" +SERVICE_SEEK_BY = "seek_by" diff --git a/homeassistant/components/channels/media_player.py b/homeassistant/components/channels/media_player.py index 6d978a5451e..e4acc2f907c 100644 --- a/homeassistant/components/channels/media_player.py +++ b/homeassistant/components/channels/media_player.py @@ -6,7 +6,6 @@ import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice from homeassistant.components.media_player.const import ( - DOMAIN, MEDIA_TYPE_CHANNEL, MEDIA_TYPE_EPISODE, MEDIA_TYPE_MOVIE, @@ -31,6 +30,8 @@ from homeassistant.const import ( ) import homeassistant.helpers.config_validation as cv +from .const import DOMAIN, SERVICE_SEEK_BACKWARD, SERVICE_SEEK_BY, SERVICE_SEEK_FORWARD + _LOGGER = logging.getLogger(__name__) DATA_CHANNELS = "channels" @@ -56,9 +57,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( } ) -SERVICE_SEEK_FORWARD = "channels_seek_forward" -SERVICE_SEEK_BACKWARD = "channels_seek_backward" -SERVICE_SEEK_BY = "channels_seek_by" # Service call validation schemas ATTR_SECONDS = "seconds" diff --git a/homeassistant/components/channels/services.yaml b/homeassistant/components/channels/services.yaml index e69de29bb2d..cbb1dd201a6 100644 --- a/homeassistant/components/channels/services.yaml +++ b/homeassistant/components/channels/services.yaml @@ -0,0 +1,23 @@ +seek_forward: + description: Seek forward by a set number of seconds. + fields: + entity_id: + description: Name of entity for the instance of Channels to seek in. + example: 'media_player.family_room_channels' + +seek_backward: + description: Seek backward by a set number of seconds. + fields: + entity_id: + description: Name of entity for the instance of Channels to seek in. + example: 'media_player.family_room_channels' + +seek_by: + description: Seek by an inputted number of seconds. + fields: + entity_id: + description: Name of entity for the instance of Channels to seek in. + example: 'media_player.family_room_channels' + seconds: + description: Number of seconds to seek by. Negative numbers seek backwards. + example: 120 diff --git a/homeassistant/components/media_player/services.yaml b/homeassistant/components/media_player/services.yaml index f30848e0078..e0ec1661e9f 100644 --- a/homeassistant/components/media_player/services.yaml +++ b/homeassistant/components/media_player/services.yaml @@ -157,30 +157,6 @@ shuffle_set: description: True/false for enabling/disabling shuffle. example: true -channels_seek_forward: - description: Seek forward by a set number of seconds. - fields: - entity_id: - description: Name of entity for the instance of Channels to seek in. - example: 'media_player.family_room_channels' - -channels_seek_backward: - description: Seek backward by a set number of seconds. - fields: - entity_id: - description: Name of entity for the instance of Channels to seek in. - example: 'media_player.family_room_channels' - -channels_seek_by: - description: Seek by an inputted number of seconds. - fields: - entity_id: - description: Name of entity for the instance of Channels to seek in. - example: 'media_player.family_room_channels' - seconds: - description: Number of seconds to seek by. Negative numbers seek backwards. - example: 120 - soundtouch_play_everywhere: description: Play on all Bose Soundtouch devices. fields: