MAJOR update. More like a Backup before things get Crazy
Added Websocket Support Added Universal Message Handling for both MQTT and WS Added Timekeeper Class, that handles Physical Clock and Scheduling Added Bell Assignment Settings, Note to Bell mapping
This commit is contained in:
@@ -1,33 +1,92 @@
|
||||
ADD MELODY:
|
||||
####################################
|
||||
## DOWNLOAD MELODY ON DEVICE:
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "add_melody",
|
||||
"cmd": "download_melody",
|
||||
"contents": {
|
||||
"url": "URL",
|
||||
"filename": "NAME.EXT"
|
||||
"download_url": "http://url.com/SDFJDLS9043FM3RM1/binaries/melody.bin",
|
||||
"melodys_uid": "SDFJDLS9043FM3RM1"
|
||||
}
|
||||
}
|
||||
|
||||
melodys_uid >> The Reference UID of the Melody in the database
|
||||
|
||||
SET RELAY TIMERS:
|
||||
|
||||
{
|
||||
"cmd": "set_relay_timers",
|
||||
"contents": {"b1":100, "b2":200}
|
||||
"status": "OK",
|
||||
"type": "Download",
|
||||
"payload": "null"
|
||||
}
|
||||
|
||||
|
||||
START PLAYBACK:
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## SET RELAY TIMERS:
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "set_relay_durations",
|
||||
"contents": {"b1":100, "b2":200}
|
||||
}
|
||||
|
||||
no reply system implemented yet
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## SET RELAY OUTPUTS:
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "set_relay_outputs",
|
||||
"contents": {"b1":1, "b2":2}
|
||||
}
|
||||
|
||||
no reply system implemented yet
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## START PLAYBACK:
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "playback",
|
||||
"contents": {
|
||||
"action": "play"
|
||||
"action": "play",
|
||||
"name": "esperinos",
|
||||
"uid": "01DegzV9FA8tYbQpkIHR",
|
||||
"url": "https://firebasestorage.googleapis.com/v0/b/bs-vesper.firebasestorage.app/o/melodies%2F01DegzV9FA8tYbQpkIHR%2Fbinary.bin?alt=media&token=f63bfc48-de0e-44cb-a2cc-4880c675558b",
|
||||
"speed": 200,
|
||||
"loop_duration": 5000,
|
||||
"pause_duration": 30000,
|
||||
"total_duration": 200,
|
||||
"continuous_loop": false
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"type": "play",
|
||||
"payload": "null"
|
||||
}
|
||||
|
||||
STOP PLAYBACK:
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## STOP PLAYBACK:
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "playback",
|
||||
@@ -36,27 +95,108 @@ STOP PLAYBACK:
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"type": "stop",
|
||||
"payload": "null"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## LIST MELODIES
|
||||
####################################
|
||||
|
||||
SET MELODY:
|
||||
|
||||
{
|
||||
"cmd": "set_melody",
|
||||
"cmd": "list_melodies"
|
||||
}
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"type": "list_melodies",
|
||||
"payload": ["jdslkfj09823jvcm", "cj2309jcvscv32", "csdvn02dsffv48nvm"]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## SYNC TIME
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "sync_time",
|
||||
"contents": {
|
||||
"name": "esperinos",
|
||||
"id": "10",
|
||||
"duration": 5000,
|
||||
"infinite": true,
|
||||
"interval": 1000,
|
||||
"speed": 200,
|
||||
"loop_dur": 2000
|
||||
"timestamp": 16546416
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LIST MELODIES
|
||||
{
|
||||
"status": "OK",
|
||||
"type": "time_set_response",
|
||||
"payload": "Time updated successfully"
|
||||
}
|
||||
|
||||
{
|
||||
"cmd": "list_melodies",
|
||||
"status": "ERROR",
|
||||
"type": "time_set_response",
|
||||
"payload": "Missing timestamp parameter"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## REPORT_TIME
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "report_time"
|
||||
}
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"type": "time_response",
|
||||
"timestamp": 2438543431, (UNIX TIME)
|
||||
"datetime": "2025-05-18T16:54:12"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## PING
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "ping"
|
||||
}
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"type": "pong",
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
####################################
|
||||
## REPORT STATUS
|
||||
####################################
|
||||
|
||||
{
|
||||
"cmd": "report_status"
|
||||
}
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"type": "current_status",
|
||||
"is_playing": true,
|
||||
"time_elapsed": 78850
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user