|
22 | 22 | from meshcore import MeshCore, EventType, logger |
23 | 23 |
|
24 | 24 | # Version |
25 | | -VERSION = "v1.0.3" |
| 25 | +VERSION = "v1.0.5" |
26 | 26 |
|
27 | 27 | # default ble address is stored in a config file |
28 | 28 | MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/" |
|
59 | 59 | ANSI_LIGHT_YELLOW = "\033[0;93m" |
60 | 60 | ANSI_LIGHT_GRAY="\033[0;38;5;247m" |
61 | 61 | ANSI_BGRAY="\033[1;38;5;247m" |
| 62 | +ANSI_ORANGE="\033[0;38;5;208m" |
| 63 | +ANSI_BORANGE="\033[1;38;5;208m" |
62 | 64 |
|
63 | 65 | def escape_ansi(line): |
64 | 66 | ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]') |
@@ -117,6 +119,8 @@ async def process_event_message(mc, ev, json_output, end="\n", above=False): |
117 | 119 |
|
118 | 120 | if ct is None: # Unknown |
119 | 121 | disp = f"{ANSI_RED}" |
| 122 | + elif ct["type"] == 4 : # sensor |
| 123 | + disp = f"{ANSI_ORANGE}" |
120 | 124 | elif ct["type"] == 3 : # room |
121 | 125 | disp = f"{ANSI_CYAN}" |
122 | 126 | elif ct["type"] == 2 : # repeater |
@@ -439,6 +443,8 @@ def _(event): |
439 | 443 | prompt = prompt + f"{ANSI_BRED}" |
440 | 444 | if classic : |
441 | 445 | prompt = prompt + "!" |
| 446 | + elif contact["type"] == 4 : # sensor |
| 447 | + prompt = prompt + f"{ANSI_BORANGE}" |
442 | 448 | elif contact["type"] == 3 : # room server |
443 | 449 | prompt = prompt + f"{ANSI_BCYAN}" |
444 | 450 | elif contact["type"] == 2 : |
@@ -597,7 +603,9 @@ def _(event): |
597 | 603 | elif contact["type"] == 1 : # chat, send to recipient and wait ack |
598 | 604 | last_ack = await msg_ack(mc, contact, line) |
599 | 605 |
|
600 | | - elif contact["type"] == 2 or contact["type"] == 3 : # repeater, send cmd |
| 606 | + elif contact["type"] == 2 or\ |
| 607 | + contact["type"] == 3 or\ |
| 608 | + contact["type"] == 4 : # repeater, room, sensor send cmd |
601 | 609 | await process_cmds(mc, ["cmd", contact["adv_name"], line]) |
602 | 610 |
|
603 | 611 | except (EOFError, KeyboardInterrupt): |
|
0 commit comments