Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update service domain for channels from 'media_player' to 'channels' #29139

Merged
merged 1 commit into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions homeassistant/components/channels/const.py
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 2 additions & 4 deletions homeassistant/components/channels/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

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,
Expand All @@ -31,6 +30,8 @@
)
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"
Expand All @@ -56,9 +57,6 @@
}
)

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"
Expand Down
23 changes: 23 additions & 0 deletions homeassistant/components/channels/services.yaml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 0 additions & 24 deletions homeassistant/components/media_player/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down