|
4 | 4 | from logging import getLogger |
5 | 5 | from typing import TYPE_CHECKING |
6 | 6 |
|
7 | | -from streamdeck.actions import ActionRegistry |
| 7 | +from streamdeck.actions import Action, ActionBase, ActionRegistry |
8 | 8 | from streamdeck.command_sender import StreamDeckCommandSender |
9 | 9 | from streamdeck.models.events import ContextualEventMixin, event_adapter |
10 | 10 | from streamdeck.types import ( |
|
21 | 21 | if TYPE_CHECKING: |
22 | 22 | from typing import Any, Literal |
23 | 23 |
|
24 | | - from streamdeck.actions import Action |
25 | 24 | from streamdeck.models.events import EventBase |
26 | 25 |
|
27 | 26 |
|
@@ -62,14 +61,14 @@ def __init__( |
62 | 61 |
|
63 | 62 | self._registry = ActionRegistry() |
64 | 63 |
|
65 | | - def register_action(self, action: Action) -> None: |
| 64 | + def register_action(self, action: ActionBase) -> None: |
66 | 65 | """Register an action with the PluginManager, and configure its logger. |
67 | 66 |
|
68 | 67 | Args: |
69 | 68 | action (Action): The action to register. |
70 | 69 | """ |
71 | 70 | # First, configure a logger for the action, giving it the last part of its uuid as name (if it has one). |
72 | | - action_component_name = action.uuid.split(".")[-1] if hasattr(action, "uuid") else "global" |
| 71 | + action_component_name = action.uuid.split(".")[-1] if isinstance(action, Action) else "global" |
73 | 72 | configure_streamdeck_logger(name=action_component_name, plugin_uuid=self.uuid) |
74 | 73 |
|
75 | 74 | self._registry.register(action) |
|
0 commit comments