mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
bug in set lat/lon/coords
This commit is contained in:
parent
b8e2280ed8
commit
12f2146f17
1 changed files with 13 additions and 7 deletions
|
|
@ -578,9 +578,12 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
else:
|
else:
|
||||||
print("ok")
|
print("ok")
|
||||||
case "lat":
|
case "lat":
|
||||||
res = await mc.commands.set_coords(\
|
if "adv_lon" in mc.self_info :
|
||||||
float(cmds[2]),\
|
lon = mc.self_info['adv_lon']
|
||||||
mc.self_infos['adv_lon'])
|
else:
|
||||||
|
lon = 0
|
||||||
|
lat = float(cmds[2])
|
||||||
|
res = await mc.commands.set_coords(lat, lon)
|
||||||
logger.debug(res)
|
logger.debug(res)
|
||||||
if res.type == EventType.ERROR:
|
if res.type == EventType.ERROR:
|
||||||
print(f"Error: {res}")
|
print(f"Error: {res}")
|
||||||
|
|
@ -589,9 +592,12 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
else:
|
else:
|
||||||
print("ok")
|
print("ok")
|
||||||
case "lon":
|
case "lon":
|
||||||
res = await mc.commands.set_coords(\
|
if "adv_lat" in mc.self_info :
|
||||||
mc.self_infos['adv_lat'],\
|
lat = mc.self_info['adv_lat']
|
||||||
float(cmds[2]))
|
else:
|
||||||
|
lat = 0
|
||||||
|
lon = float(cmds[2])
|
||||||
|
res = await mc.commands.set_coords(lat, lon)
|
||||||
logger.debug(res)
|
logger.debug(res)
|
||||||
if res.type == EventType.ERROR:
|
if res.type == EventType.ERROR:
|
||||||
print(f"Error: {res}")
|
print(f"Error: {res}")
|
||||||
|
|
@ -600,7 +606,7 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
else:
|
else:
|
||||||
print("ok")
|
print("ok")
|
||||||
case "coords":
|
case "coords":
|
||||||
params=cmds[2].commands.split(",")
|
params=cmds[2].split(",")
|
||||||
res = await mc.commands.set_coords(\
|
res = await mc.commands.set_coords(\
|
||||||
float(params[0]),\
|
float(params[0]),\
|
||||||
float(params[1]))
|
float(params[1]))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue