diff --git a/.coveragerc b/.coveragerc index e859e05f6ee8e37f2c44bdd94b9ad4c764fceaf1..73b203a181ad8d7d81c01208d954a198184b7b34 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 0000000000000000000000000000000000000000..5ae7fdebb0b19f5fe2fcb2f51e19e3dc7b6ef3c4 --- /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 6d978a5451e3544c319b742958b1eca3a9e83853..e4acc2f907c862d7ff1eaf88f8cd7d108183dc1d 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cbb1dd201a67b4c0dc6c28a59350fb9d8b84dbd9 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 f30848e0078ab7771562f72b2226309ceaf04c10..e0ec1661e9fcfd3f8b1aa45b8b3a95010b2d8da4 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: