1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-22 03:19:03 +00:00

Send event when add-on changes state (#2608)

* Send event when add-on changes state

* fix test
This commit is contained in:
Joakim Sørensen
2021-02-23 15:12:30 +01:00
committed by GitHub
parent 3802b97bb6
commit 90d8832cd2
6 changed files with 90 additions and 38 deletions

View File

@@ -0,0 +1,26 @@
"""Constants for homeassistant."""
from enum import Enum
from ..const import CoreState
MIN_VERSION = {"supervisor/event": "2021.2.4"}
CLOSING_STATES = [
CoreState.SHUTDOWN,
CoreState.STOPPING,
CoreState.CLOSE,
]
class WSType(str, Enum):
"""Websocket types."""
AUTH = "auth"
SUPERVISOR_EVENT = "supervisor/event"
class WSEvent(str, Enum):
"""Websocket events."""
ADDON = "addon"
SUPERVISOR_UPDATE = "supervisor_update"