AllskyTeam / allsky

A Raspberry Pi operated Wireless Allsky Camera
MIT License
1.16k stars 180 forks source link

Implement Allsky status #3479

Closed EricClaeys closed 6 months ago

EricClaeys commented 6 months ago

Keep track of the current status of Allsky. ~/allsky/variables defines:

ALLSKY_STATUS="${ALLSKY_CONFIG}/status.json"
ALLSKY_STATUS_INSTALLING="Installing..."
ALLSKY_STATUS_NEVER_RUN="Never Run"
ALLSKY_STATUS_NOT_RUNNING="Not Running"
ALLSKY_STATUS_STARTING="Starting..."
ALLSKY_STATUS_RUNNING="Running"
ALLSKY_STATUS_STOPPED="Stopped (normal)"
ALLSKY_STATUS_ERROR="Stopped (error detected)"
ALLSKY_STATUS_SEE_WEBUI="See the WebUI"

Shell scripts can call set_allsky_status ONE_OF_THE_VARIABLES_ABOVE to set the status. It also have a timestamp of when the status was last updated. Not sure if we'll ever need it though.

Shell scripts can call get_allsky_status to get the status (one of the strings above). If they need the the timestamp, call get_allsky_status_timestamp.

The WebUI has a define(ALLSKY_STATUS) set to ${ALLSKY_STATUS}. It does NOT have variables for the various status strings.

EricClaeys commented 6 months ago

Alex, let me know if you think the status should be stored in the settings file instead of a separate file. That's make getting the status from Python files easy. I can do another PR to change it.

Alex-developer commented 6 months ago

Alex, let me know if you think the status should be stored in the settings file instead of a separate file. That's make getting the status from Python files easy. I can do another PR to change it.

Eric

Its fine in a separate file

Cheers

Alex