-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path__init__.py
More file actions
98 lines (80 loc) · 2.9 KB
/
__init__.py
File metadata and controls
98 lines (80 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
"""Stream Deck Event Models.
These models are used to represent the events that can be received by the Stream Deck SDK plugin.
The "default" events are those passed from the Stream Deck software itself, but custom events can
be created by the plugin developer and listened for in the same way.
The events are organized into the same categories as the Stream Deck SDK documentation defines them.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from streamdeck.models.events.application import ApplicationDidLaunch, ApplicationDidTerminate
from streamdeck.models.events.base import EventBase
from streamdeck.models.events.deep_link import DidReceiveDeepLink
from streamdeck.models.events.devices import DeviceDidConnect, DeviceDidDisconnect
from streamdeck.models.events.dials import DialDown, DialRotate, DialUp
from streamdeck.models.events.keys import KeyDown, KeyUp
from streamdeck.models.events.property_inspector import (
DidReceivePropertyInspectorMessage,
PropertyInspectorDidAppear,
PropertyInspectorDidDisappear,
)
from streamdeck.models.events.settings import DidReceiveGlobalSettings, DidReceiveSettings
from streamdeck.models.events.system import SystemDidWakeUp
from streamdeck.models.events.title_parameters import TitleParametersDidChange
from streamdeck.models.events.touch_tap import TouchTap
from streamdeck.models.events.visibility import WillAppear, WillDisappear
if TYPE_CHECKING:
from typing import Final
from streamdeck.models.events.base import LiteralStrGenericAlias
DEFAULT_EVENT_MODELS: Final[list[type[EventBase[LiteralStrGenericAlias]]]] = [
ApplicationDidLaunch,
ApplicationDidTerminate,
DeviceDidConnect,
DeviceDidDisconnect,
DialDown,
DialRotate,
DialUp,
DidReceiveDeepLink,
KeyUp,
KeyDown,
DidReceivePropertyInspectorMessage,
PropertyInspectorDidAppear,
PropertyInspectorDidDisappear,
DidReceiveGlobalSettings,
DidReceiveSettings,
SystemDidWakeUp,
TitleParametersDidChange,
TouchTap,
WillAppear,
WillDisappear,
]
def _get_default_event_names() -> set[str]:
default_event_names: set[str] = set()
for event_model in DEFAULT_EVENT_MODELS:
default_event_names.update(event_model.get_model_event_names())
return default_event_names
DEFAULT_EVENT_NAMES: Final[set[str]] = _get_default_event_names()
__all__ = [
"DEFAULT_EVENT_MODELS",
"DEFAULT_EVENT_NAMES",
"ApplicationDidLaunch",
"ApplicationDidTerminate",
"DeviceDidConnect",
"DeviceDidDisconnect",
"DialDown",
"DialRotate",
"DialUp",
"DidReceiveDeepLink",
"DidReceiveGlobalSettings",
"DidReceivePropertyInspectorMessage",
"DidReceiveSettings",
"EventBase",
"KeyDown",
"KeyUp",
"PropertyInspectorDidAppear",
"PropertyInspectorDidDisappear",
"SystemDidWakeUp",
"TitleParametersDidChange",
"TouchTap",
"WillAppear",
"WillDisappear",
]