Utility modules (pyobs.modules.utils)
Utilities TODO: write doc
AutonomousWarning
- class AutonomousWarning(warn_sound: str, warn_interval: float = 1, start_sound: Optional[str] = None, started_sound: Optional[str] = None, stop_sound: Optional[str] = None, stopped_sound: Optional[str] = None, player: str = 'mpg123', trigger_file: Optional[str] = None, **kwargs: Any)
Bases:
Module
A module that can plays a warning sound while an IAutonomous module is running.
Initialize a new warning.
- Parameters:
warn_sound – Name of file to play.
warn_interval – Interval in seconds between sounds.
start_sound – Sound to play when starting systems.
started_sound – Sound to play when systems started.
stop_sound – Sound to play when stopping systems.
stopped_sound – Sound to play when systems stopped.
trigger_file – File, which triggers to switch on-off and vice versa, when created. Will be deleted afterwards.
FluentLogger
Kiosk
- class Kiosk(camera: Union[ICamera, str], port: int = 37077, **kwargs: Any)
Bases:
Module
,IStartStop
A kiosk mode for a pyobs camera that takes images and published them via HTTP.
Initializes file cache.
- Parameters:
camera – Camera to use for kiosk mode.
port – Port for HTTP server.
- async image_handler(request: Request) Response [source]
Handles access to /* and returns a specified image.
- Parameters:
request – Request to respond to.
- Returns:
Response containing image.
- property opened: bool
Whether the server is started.
Telegram
Trigger
- class Trigger(triggers: List[Dict[str, Any]], **kwargs: Any)
Bases:
Module
,IAutonomous
A module that can call another module’s methods when a specific event occurs.
Initialize a new trigger module.
- Parameters:
triggers – List of dictionaries defining the trigger. Must contain fields for event, module and method, may contain a sender.