added listener function to cfg util

This commit is contained in:
UpstreamData
2022-05-30 13:27:56 -06:00
parent 739126935a
commit dd5ccafa1e
4 changed files with 84 additions and 22 deletions

View File

@@ -9,6 +9,8 @@ from tools.cfg_util.commands import (
btn_reboot,
btn_backend,
btn_command,
btn_cancel_listen,
btn_listen,
)
from tools.cfg_util.configure import (
generate_config_ui,
@@ -193,6 +195,10 @@ async def ui():
_table = "cmd_table"
_ips = value[_table]
asyncio.create_task(btn_command(_ips, value["cmd_txt"]))
if event == "cmd_listen":
asyncio.create_task(btn_listen())
if event.endswith("cancel_listen"):
asyncio.create_task(btn_cancel_listen())
if event == "__TIMEOUT__":
await asyncio.sleep(0)