mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 09:57:43 +00:00
Co-authored-by: Jonathan Swoboda <swoboda1337@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
33 lines
927 B
Python
33 lines
927 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
from esphome.enum import StrEnum
|
|
|
|
|
|
class DashboardEvent(StrEnum):
|
|
"""Dashboard WebSocket event types."""
|
|
|
|
# Server -> Client events (backend sends to frontend)
|
|
ENTRY_ADDED = "entry_added"
|
|
ENTRY_REMOVED = "entry_removed"
|
|
ENTRY_UPDATED = "entry_updated"
|
|
ENTRY_STATE_CHANGED = "entry_state_changed"
|
|
IMPORTABLE_DEVICE_ADDED = "importable_device_added"
|
|
IMPORTABLE_DEVICE_REMOVED = "importable_device_removed"
|
|
INITIAL_STATE = "initial_state" # Sent on WebSocket connection
|
|
PONG = "pong" # Response to client ping
|
|
|
|
# Client -> Server events (frontend sends to backend)
|
|
PING = "ping" # WebSocket keepalive from client
|
|
REFRESH = "refresh" # Force backend to poll for changes
|
|
|
|
|
|
MAX_EXECUTOR_WORKERS = 48
|
|
|
|
|
|
SENTINEL = object()
|
|
|
|
ESPHOME_COMMAND = [sys.executable, "-m", "esphome"]
|
|
DASHBOARD_COMMAND = [*ESPHOME_COMMAND, "--dashboard"]
|