Skip to content

Scripts

project-owner edited this page Jun 11, 2023 · 2 revisions

There are six scripts available to provide a custom user-defined logic during player startup and shutdown, screensaver start/stop and timer start/stop:

/home/pi/Peppy/scripts/playerstart.py
/home/pi/Peppy/scripts/playerstop.py
/home/pi/Peppy/scripts/screensaverstart.py
/home/pi/Peppy/scripts/screensaverstop.py
/home/pi/Peppy/scripts/timerstart.py
/home/pi/Peppy/scripts/timerstop.py

Those scripts are just the templates where users can place their own logic. The scripts will be executed during start and stop processes respectively. By default the scripts have just the logging implementation. Users can add any logic to those scripts. For example that can be the logic for switching on/off some additional devices, the logic for reading data from sensors, handling the acquired data and so on.

The scripts can work in two modes:

  • Synchronous - in this mode the player will wait until the custom logic finishes the execution
  • Asynchronous - in this mode the player will start the script in a separate thread and it will continue the execution without waiting the script termination.

The startup script can be either synchronous or asynchronous. The shutdown script can be only synchronous to avoid abnormal termination.

<<Previous | Next>>

Clone this wiki locally