mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
clock command now works as in repeater cli
This commit is contained in:
parent
27fe6467b5
commit
70706cae2f
1 changed files with 8 additions and 4 deletions
12
mccli.py
12
mccli.py
|
|
@ -578,10 +578,14 @@ async def next_cmd(mc, cmds):
|
|||
argnum = 0
|
||||
match cmds[0] :
|
||||
case "get_time" | "clock" :
|
||||
timestamp = await mc.get_time()
|
||||
print('Current time :'
|
||||
f' {datetime.datetime.fromtimestamp(timestamp).strftime("%Y-%m-%d %H:%M:%S")}'
|
||||
f' ({timestamp})')
|
||||
if len(cmds) > 1 and cmds[1] == "sync" :
|
||||
argnum=1
|
||||
print(await mc.set_time(int(time.time())))
|
||||
else:
|
||||
timestamp = await mc.get_time()
|
||||
print('Current time :'
|
||||
f' {datetime.datetime.fromtimestamp(timestamp).strftime("%Y-%m-%d %H:%M:%S")}'
|
||||
f' ({timestamp})')
|
||||
case "sync_time"|"clock sync":
|
||||
print(await mc.set_time(int(time.time())))
|
||||
case "set_time" :
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue