File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,7 @@ Play audio stream.
222
222
Control of one or more remote voice satellites connected to a central server.
223
223
224
224
* ` run-satellite ` - informs satellite that server is ready to run pipelines
225
+ * ` start_stage ` - request pipelines with a specific starting stage (string, optional)
225
226
* ` pause-satellite ` - informs satellite that server is not ready anymore to run pipelines
226
227
* ` satellite-connected ` - satellite has connected to the server
227
228
* ` satellite-disconnected ` - satellite has been disconnected from the server
Original file line number Diff line number Diff line change 1
1
"""Satellite events."""
2
2
from dataclasses import dataclass
3
+ from typing import Any , Dict , Optional
3
4
4
5
from .event import Event , Eventable
6
+ from .pipeline import PipelineStage
5
7
6
8
_RUN_SATELLITE_TYPE = "run-satellite"
7
9
_PAUSE_SATELLITE_TYPE = "pause-satellite"
15
17
class RunSatellite (Eventable ):
16
18
"""Informs the satellite that the server is ready to run a pipeline."""
17
19
20
+ start_stage : Optional [PipelineStage ] = None
21
+
18
22
@staticmethod
19
23
def is_type (event_type : str ) -> bool :
20
24
return event_type == _RUN_SATELLITE_TYPE
21
25
22
26
def event (self ) -> Event :
23
- return Event (type = _RUN_SATELLITE_TYPE )
27
+ data : Dict [str , Any ] = {}
28
+
29
+ if self .start_stage is not None :
30
+ data ["start_stage" ] = self .start_stage .value
31
+
32
+ return Event (type = _RUN_SATELLITE_TYPE , data = data )
24
33
25
34
@staticmethod
26
35
def from_event (event : Event ) -> "RunSatellite" :
27
- return RunSatellite ()
36
+ # note: older versions don't send event.data
37
+ start_stage = None
38
+ if value := (event .data or {}).get ("start_stage" ):
39
+ start_stage = PipelineStage (value )
40
+
41
+ return RunSatellite (start_stage = start_stage )
28
42
29
43
30
44
@dataclass
You can’t perform that action at this time.
0 commit comments