Work on event launcher related
This commit is contained in:
@@ -177,7 +177,33 @@ def load_event_obj(
|
|||||||
event_obj.event_cfg = event_cfg_result
|
event_obj.event_cfg = event_cfg_result
|
||||||
else: event_obj.event_cfg = {} # None
|
else: event_obj.event_cfg = {} # None
|
||||||
|
|
||||||
if inc_event_device_list: pass
|
# Updated 2022-04-17
|
||||||
|
if inc_event_device_list:
|
||||||
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
|
log.info('Need to include event device list...')
|
||||||
|
|
||||||
|
from app.methods.event_device_methods import get_event_device_rec_list, load_event_device_obj
|
||||||
|
if event_device_rec_list_result := get_event_device_rec_list(
|
||||||
|
for_type = 'event',
|
||||||
|
for_id = event_id,
|
||||||
|
# event_id = event_id,
|
||||||
|
enabled = enabled,
|
||||||
|
):
|
||||||
|
event_device_result_list = []
|
||||||
|
for event_device_rec in event_device_rec_list_result:
|
||||||
|
if load_event_device_result := load_event_device_obj(
|
||||||
|
event_device_id = event_device_rec.get('event_device_id', None),
|
||||||
|
enabled = enabled,
|
||||||
|
):
|
||||||
|
event_device_result_list.append(load_event_device_result)
|
||||||
|
else:
|
||||||
|
event_device_result_list.append(None)
|
||||||
|
log.debug(event_device_result_list)
|
||||||
|
event_obj.event_device_list = event_device_result_list
|
||||||
|
elif isinstance(event_device_rec_list_result, list):
|
||||||
|
event_obj.event_device_list = []
|
||||||
|
else:
|
||||||
|
event_obj.event_device_list = None
|
||||||
|
|
||||||
# Updated 2022-03-30
|
# Updated 2022-03-30
|
||||||
if inc_event_exhibit_list:
|
if inc_event_exhibit_list:
|
||||||
|
|||||||
@@ -38,12 +38,21 @@ class Event_Device_Base(BaseModel):
|
|||||||
name: Optional[str]
|
name: Optional[str]
|
||||||
description: Optional[str]
|
description: Optional[str]
|
||||||
|
|
||||||
|
app_mode: Optional[str] # null, default, onsite, app
|
||||||
|
use_local_api: Optional[bool]
|
||||||
|
use_local_app: Optional[bool]
|
||||||
|
|
||||||
api_secret_key: Optional[str]
|
api_secret_key: Optional[str]
|
||||||
|
|
||||||
host_file_cache_path: Optional[str] # Path for hash file cache only
|
host_file_cache_path: Optional[str] # Path for hash file cache only
|
||||||
host_file_temp_path: Optional[str] # Path for copied and renamed temporary files from hash file cache directory
|
host_file_temp_path: Optional[str] # Path for copied and renamed temporary files from hash file cache directory
|
||||||
recording_path: Optional[str] # Path to save recordings
|
recording_path: Optional[str] # Path to save recordings
|
||||||
|
|
||||||
|
check_event_loop_period: Optional[int]
|
||||||
|
check_event_device_loop_period: Optional[int]
|
||||||
|
check_event_location_loop_period: Optional[int]
|
||||||
|
check_event_session_loop_period: Optional[int]
|
||||||
|
|
||||||
enable: Optional[bool]
|
enable: Optional[bool]
|
||||||
|
|
||||||
# hide: Optional[bool]
|
# hide: Optional[bool]
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ async def get_event_obj(
|
|||||||
# inc_event_abstract_list = inc_event_abstract_list,
|
# inc_event_abstract_list = inc_event_abstract_list,
|
||||||
# inc_event_badge_list = inc_event_badge_list,
|
# inc_event_badge_list = inc_event_badge_list,
|
||||||
inc_event_cfg = inc_event_cfg,
|
inc_event_cfg = inc_event_cfg,
|
||||||
# inc_event_device_list = inc_event_device_list,
|
inc_event_device_list = inc_event_device_list,
|
||||||
inc_event_exhibit_list = inc_event_exhibit_list,
|
inc_event_exhibit_list = inc_event_exhibit_list,
|
||||||
inc_event_file_list = inc_event_file_list,
|
inc_event_file_list = inc_event_file_list,
|
||||||
inc_event_location = inc_event_location,
|
inc_event_location = inc_event_location,
|
||||||
|
|||||||
Reference in New Issue
Block a user