refresh infos when getting parameters

This commit is contained in:
Florent 2025-04-21 16:58:00 +02:00
parent b53b31682d
commit 53f89c84c5
2 changed files with 6 additions and 1 deletions

View file

@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "meshcore-cli" name = "meshcore-cli"
version = "0.6.12" version = "0.6.13"
authors = [ authors = [
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
] ]

View file

@ -661,21 +661,25 @@ async def next_cmd(mc, cmds, json_output=False):
else: else:
print(f"{'on' if process_event_message.print_snr else 'off'}") print(f"{'on' if process_event_message.print_snr else 'off'}")
case "name": case "name":
await mc.commands.send_appstart()
if json_output : if json_output :
print(json.dumps(mc.self_info["name"])) print(json.dumps(mc.self_info["name"]))
else: else:
print(mc.self_info["name"]) print(mc.self_info["name"])
case "tx": case "tx":
await mc.commands.send_appstart()
if json_output : if json_output :
print(json.dumps(mc.self_info["tx_power"])) print(json.dumps(mc.self_info["tx_power"]))
else: else:
print(mc.self_info["tx_power"]) print(mc.self_info["tx_power"])
case "coords": case "coords":
await mc.commands.send_appstart()
if json_output : if json_output :
print(json.dumps({"lat": mc.self_info["adv_lat"], "lon":mc.self_info["adv_lon"]})) print(json.dumps({"lat": mc.self_info["adv_lat"], "lon":mc.self_info["adv_lon"]}))
else: else:
print(f"{mc.self_info['adv_lat']},{mc.self_info['adv_lon']}") print(f"{mc.self_info['adv_lat']},{mc.self_info['adv_lon']}")
case "radio": case "radio":
await mc.commands.send_appstart()
if json_output : if json_output :
print(json.dumps( print(json.dumps(
{"radio_freq": mc.self_info["radio_freq"], {"radio_freq": mc.self_info["radio_freq"],
@ -1001,6 +1005,7 @@ async def next_cmd(mc, cmds, json_output=False):
print("]") print("]")
case "infos" | "i" : case "infos" | "i" :
await mc.commands.send_appstart()
print(json.dumps(mc.self_info,indent=4)) print(json.dumps(mc.self_info,indent=4))
case "advert" | "a": case "advert" | "a":