move service constants to const.py and move channels services to channels domain (#29139)

pull/29170/head
Raman Gupta 2019-11-27 05:23:52 -05:00 committed by Pascal Vizeli
parent 1f13809c6d
commit ec61a86678
5 changed files with 31 additions and 29 deletions

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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: