Skip to content

Commit

Permalink
Refs #14. Changed created session name
Browse files Browse the repository at this point in the history
  • Loading branch information
SBriere committed Apr 17, 2024
1 parent e3e03f3 commit f0ac21f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libs/servers/WatchServerOpenTera.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def sync_files(self):

def initiate_opentera_transfer(self, device_name: str):
# Only one thread can transfer at a time - this prevent file conflicts
with opentera_lock:
with (opentera_lock):
logging.info("WatchServerOpenTera: Initiating data transfer for " + device_name + "...")

if device_name in self._device_timeouts:
Expand Down Expand Up @@ -215,7 +215,10 @@ def initiate_opentera_transfer(self, device_name: str):
logging.warning('No session timestamp found - using current time')
session_starttime = datetime.datetime.now()

session_name = device_name + ' (PiHub) ' + session_starttime.strftime("%Y-%m-%d")
session_name = device_name
if 'device_subtype' in device_infos:
session_name += ' [' + device_infos['device_subtype'] + ']'
session_name += ' - ' + session_starttime.strftime("%Y-%m-%d %H:%M:%S")

session_info = {'id_session': 0, 'session_name': session_name,
'session_start_datetime': session_starttime.isoformat(),
Expand Down

0 comments on commit f0ac21f

Please sign in to comment.