mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
move service constants to const.py, move custom services to monoprice domain (#29099)
This commit is contained in:
parent
c1163283ff
commit
499838d5a7
@ -107,20 +107,6 @@ media_seek:
|
||||
description: Position to seek to. The format is platform dependent.
|
||||
example: 100
|
||||
|
||||
monoprice_snapshot:
|
||||
description: Take a snapshot of the media player zone.
|
||||
fields:
|
||||
entity_id:
|
||||
description: Name(s) of entities that will be snapshot. Platform dependent.
|
||||
example: 'media_player.living_room'
|
||||
|
||||
monoprice_restore:
|
||||
description: Restore a snapshot of the media player zone.
|
||||
fields:
|
||||
entity_id:
|
||||
description: Name(s) of entities that will be restored. Platform dependent.
|
||||
example: 'media_player.living_room'
|
||||
|
||||
play_media:
|
||||
description: Send the media player the command for playing media.
|
||||
fields:
|
||||
|
5
homeassistant/components/monoprice/const.py
Normal file
5
homeassistant/components/monoprice/const.py
Normal file
@ -0,0 +1,5 @@
|
||||
"""Constants for the Monoprice 6-Zone Amplifier Media Player component."""
|
||||
|
||||
DOMAIN = "monoprice"
|
||||
SERVICE_SNAPSHOT = "snapshot"
|
||||
SERVICE_RESTORE = "restore"
|
@ -5,7 +5,6 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
|
||||
from homeassistant.components.media_player.const import (
|
||||
DOMAIN,
|
||||
SUPPORT_SELECT_SOURCE,
|
||||
SUPPORT_TURN_OFF,
|
||||
SUPPORT_TURN_ON,
|
||||
@ -21,6 +20,7 @@ from homeassistant.const import (
|
||||
STATE_ON,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from .const import DOMAIN, SERVICE_RESTORE, SERVICE_SNAPSHOT
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -42,9 +42,6 @@ CONF_SOURCES = "sources"
|
||||
|
||||
DATA_MONOPRICE = "monoprice"
|
||||
|
||||
SERVICE_SNAPSHOT = "snapshot"
|
||||
SERVICE_RESTORE = "restore"
|
||||
|
||||
# Valid zone ids: 11-16 or 21-26 or 31-36
|
||||
ZONE_IDS = vol.All(
|
||||
vol.Coerce(int),
|
||||
|
@ -0,0 +1,13 @@
|
||||
snapshot:
|
||||
description: Take a snapshot of the media player zone.
|
||||
fields:
|
||||
entity_id:
|
||||
description: Name(s) of entities that will be snapshot. Platform dependent.
|
||||
example: 'media_player.living_room'
|
||||
|
||||
restore:
|
||||
description: Restore a snapshot of the media player zone.
|
||||
fields:
|
||||
entity_id:
|
||||
description: Name(s) of entities that will be restored. Platform dependent.
|
||||
example: 'media_player.living_room'
|
@ -5,7 +5,6 @@ import voluptuous as vol
|
||||
|
||||
from collections import defaultdict
|
||||
from homeassistant.components.media_player.const import (
|
||||
DOMAIN,
|
||||
SUPPORT_TURN_ON,
|
||||
SUPPORT_TURN_OFF,
|
||||
SUPPORT_VOLUME_MUTE,
|
||||
@ -19,10 +18,13 @@ import tests.common
|
||||
from homeassistant.components.monoprice.media_player import (
|
||||
DATA_MONOPRICE,
|
||||
PLATFORM_SCHEMA,
|
||||
SERVICE_SNAPSHOT,
|
||||
SERVICE_RESTORE,
|
||||
setup_platform,
|
||||
)
|
||||
from homeassistant.components.monoprice.const import (
|
||||
DOMAIN,
|
||||
SERVICE_RESTORE,
|
||||
SERVICE_SNAPSHOT,
|
||||
)
|
||||
import pytest
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user