Cleanup and add defaults

This commit is contained in:
Tim 2022-02-12 18:00:27 +00:00
parent 2a897edb10
commit 53db7e744a
No known key found for this signature in database
GPG Key ID: E95CE08DB3F50537
9 changed files with 93 additions and 59 deletions

17
scripts/alert.json Normal file
View File

@ -0,0 +1,17 @@
{
"process_name": "Show basic alert process",
"step1": {
"name": "trigger_alert",
"payload": {
"text": "Some Text",
"min": 0
}
},
"step2": {
"name": "trigger_alert",
"payload": {
"text": "Some more text Text",
"delay": 5
}
}
}

View File

@ -1,6 +0,0 @@
---
process_name: Show basic alert process
step1:
payload:
text: Show some text
name: trigger_alert

6
scripts/live_item.json Normal file
View File

@ -0,0 +1,6 @@
{
"process_name": "live_item",
"step1": {
"name": "play_live_items"
}
}

View File

@ -1,4 +0,0 @@
---
process_name: live_item
step1:
name: play_live_items

33
scripts/media.json Normal file
View File

@ -0,0 +1,33 @@
{
"process_name": "play media",
"step1": {
"name": "clear_live_controller",
"payload": {
"max": 1,
"min": 1
}
},
"step2": {
"name": "clear_preview_controller",
"payload": {
"delay": 1
}
},
"step3": {
"name": "search_and_add",
"delay": 10
"payload": {
"plugin": "media"
}
},
"step4": {
"name": "load_service_sequential"
},
"step5": {
"delay": 30
"name": "flush_pending"
},
"step6": {
"name": "media_pause"
}
}

View File

@ -1,21 +0,0 @@
---
process_name: play media
step1:
max: 1
min: 1
name: clear_live_controller
step2:
delay: 1
name: clear_preview_controller
step3:
delay: 10
name: search_and_add
payload:
plugin: media
step4:
name: load_service_sequential
step5:
delay: 30
name: flush_pending
step6:
name: media_pause

34
scripts/test.json Normal file
View File

@ -0,0 +1,34 @@
{
"process_name": "play media",
"step1": {
"name": "clear_live_controller",
"max": 1,
"min": 1
},
"step2": {
"name": "clear_preview_controller",
"delay": 1
},
"step3": {
"name": "new_service",
"max": 1,
"min": 1
},
"step4": {
"name": "search_and_add",
"delay": 1,
"payload": {
"plugin": "songs"
}
},
"step5": {
"name": "search_and_add",
"delay": 1,
"payload": {
"plugin": "bibles"
}
},
"step6": {
"name": "load_service_sequential"
}
}

View File

@ -1,25 +0,0 @@
---
process_name: test process
step1:
max: 1
min: 1
name: clear_live_controller
step2:
delay: 1
name: clear_preview_controller
step3:
max: 1
min: 1
name: new_service
step4:
delay: 1
name: search_and_add
payload:
plugin: songs
step5:
delay: 1
name: search_and_add
payload:
plugin: bibles
step6:
name: load_service_sequential

View File

@ -20,7 +20,7 @@
import argparse import argparse
import threading import threading
import websocket import websocket
import yaml import json
from collections import deque from collections import deque
from websocket import create_connection from websocket import create_connection
@ -82,7 +82,7 @@ class RunTestsController(object):
print_info(f"Socket Listener Opened") print_info(f"Socket Listener Opened")
@staticmethod @staticmethod
def on_close() -> None: def on_close(ws_obj: object) -> None:
print_info("Socket Listener Closed") print_info("Socket Listener Closed")
@staticmethod @staticmethod
@ -119,7 +119,7 @@ class RunTestsController(object):
f_open = f'{a.rargs[0]}' f_open = f'{a.rargs[0]}'
print(f_open) print(f_open)
with open(f_open, 'r') as file: with open(f_open, 'r') as file:
commands = yaml.load(file, Loader=yaml.SafeLoader) commands = json.load(file)
for step in commands: for step in commands:
if step == 'process_name': if step == 'process_name':
print_info(f'Processing file {commands[step]}') print_info(f'Processing file {commands[step]}')