1111from pyoverkiz .models import Action
1212
1313if TYPE_CHECKING :
14- from pyoverkiz .enums import CommandMode
14+ from pyoverkiz .enums import ExecutionMode
1515
1616
1717@dataclass (frozen = True , slots = True )
@@ -78,15 +78,15 @@ class ActionQueue:
7878 The batch is flushed when:
7979 - The delay timer expires
8080 - The max actions limit is reached
81- - The command mode changes
81+ - The execution mode changes
8282 - The label changes
8383 - Manual flush is requested
8484 """
8585
8686 def __init__ (
8787 self ,
8888 executor : Callable [
89- [list [Action ], CommandMode | None , str | None ], Coroutine [None , None , str ]
89+ [list [Action ], ExecutionMode | None , str | None ], Coroutine [None , None , str ]
9090 ],
9191 delay : float = 0.5 ,
9292 max_actions : int = 20 ,
@@ -102,7 +102,7 @@ def __init__(
102102 self ._max_actions = max_actions
103103
104104 self ._pending_actions : list [Action ] = []
105- self ._pending_mode : CommandMode | None = None
105+ self ._pending_mode : ExecutionMode | None = None
106106 self ._pending_label : str | None = None
107107 self ._pending_waiters : list [QueuedExecution ] = []
108108
@@ -121,7 +121,7 @@ def _copy_action(action: Action) -> Action:
121121 async def add (
122122 self ,
123123 actions : list [Action ],
124- mode : CommandMode | None = None ,
124+ mode : ExecutionMode | None = None ,
125125 label : str | None = None ,
126126 ) -> QueuedExecution :
127127 """Add actions to the queue.
@@ -132,7 +132,7 @@ async def add(
132132
133133 Args:
134134 actions: Actions to queue.
135- mode: Command mode, which triggers a flush if it differs from the
135+ mode: Execution mode, which triggers a flush if it differs from the
136136 pending mode.
137137 label: Label for the action group.
138138
@@ -141,7 +141,7 @@ async def add(
141141 executes.
142142 """
143143 batches_to_execute : list [
144- tuple [list [Action ], CommandMode | None , str | None , list [QueuedExecution ]]
144+ tuple [list [Action ], ExecutionMode | None , str | None , list [QueuedExecution ]]
145145 ] = []
146146
147147 if not actions :
@@ -235,7 +235,7 @@ async def _delayed_flush(self) -> None:
235235
236236 def _prepare_flush (
237237 self ,
238- ) -> tuple [list [Action ], CommandMode | None , str | None , list [QueuedExecution ]]:
238+ ) -> tuple [list [Action ], ExecutionMode | None , str | None , list [QueuedExecution ]]:
239239 """Prepare a flush by taking snapshot and clearing state (must be called with lock held).
240240
241241 Returns a tuple of (actions, mode, label, waiters) that should be executed
@@ -266,7 +266,7 @@ def _prepare_flush(
266266 async def _execute_batch (
267267 self ,
268268 actions : list [Action ],
269- mode : CommandMode | None ,
269+ mode : ExecutionMode | None ,
270270 label : str | None ,
271271 waiters : list [QueuedExecution ],
272272 ) -> None :
0 commit comments