Files
haos-hacs-integration-media…/custom_components/remote_media_player/const.py
alexei.dolgolyov e66f2f3b36 Add turn_on/turn_off/toggle support
- Add API_TURN_ON, API_TURN_OFF, API_TOGGLE constants
- Add turn_on(), turn_off(), toggle() methods to MediaServerClient
- Implement async_turn_on, async_turn_off, async_toggle in media player
- Add TURN_ON and TURN_OFF to supported features
- Update README with turn on/off/toggle documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 03:44:25 +03:00

44 lines
1.1 KiB
Python

"""Constants for the Remote Media Player integration."""
DOMAIN = "remote_media_player"
# Configuration keys
CONF_HOST = "host"
CONF_PORT = "port"
CONF_TOKEN = "token"
CONF_POLL_INTERVAL = "poll_interval"
CONF_NAME = "name"
CONF_USE_WEBSOCKET = "use_websocket"
# Default values
DEFAULT_PORT = 8765
DEFAULT_POLL_INTERVAL = 5
DEFAULT_NAME = "Remote Media Player"
DEFAULT_USE_WEBSOCKET = True
DEFAULT_RECONNECT_INTERVAL = 30
# API endpoints
API_HEALTH = "/api/health"
API_STATUS = "/api/media/status"
API_PLAY = "/api/media/play"
API_PAUSE = "/api/media/pause"
API_STOP = "/api/media/stop"
API_NEXT = "/api/media/next"
API_PREVIOUS = "/api/media/previous"
API_VOLUME = "/api/media/volume"
API_MUTE = "/api/media/mute"
API_SEEK = "/api/media/seek"
API_TURN_ON = "/api/media/turn_on"
API_TURN_OFF = "/api/media/turn_off"
API_TOGGLE = "/api/media/toggle"
API_SCRIPTS_LIST = "/api/scripts/list"
API_SCRIPTS_EXECUTE = "/api/scripts/execute"
API_WEBSOCKET = "/api/media/ws"
# Service names
SERVICE_EXECUTE_SCRIPT = "execute_script"
# Service attributes
ATTR_SCRIPT_NAME = "script_name"
ATTR_SCRIPT_ARGS = "args"