Skip to content

Commit cba29f6

Browse files
committed
tools: localhost: display network ID
Display the network ID used by a device in the localhost table. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent 54dd82f commit cba29f6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/infuse_iot/tools/localhost.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from aiohttp.web_request import BaseRequest
1616
from aiohttp.web_runner import GracefulExit
1717

18+
import infuse_iot.epacket.packet as packet
1819
import infuse_iot.epacket.interface as interface
1920
from infuse_iot.commands import InfuseCommand
2021
from infuse_iot.common import InfuseType
@@ -81,6 +82,11 @@ async def websocket_handler(self, request: BaseRequest):
8182
"field": "application",
8283
"headerHozAlign": "center",
8384
},
85+
{
86+
"title": "Network",
87+
"field": "network_id",
88+
"headerHozAlign": "center",
89+
},
8490
{
8591
"title": "Last Heard",
8692
"field": "time",
@@ -203,6 +209,9 @@ def recv_thread(self) -> None:
203209
self._data[source.infuse_id]["bt_addr"] = addr_str
204210
self._data[source.infuse_id]["bt_rssi"] = source.rssi
205211

212+
if source.auth == packet.Auth.NETWORK:
213+
self._data[source.infuse_id]["network_id"] = f"0x{source.key_identifier:06x}"
214+
206215
for tdf in self._decoder.decode(msg.epacket.payload):
207216
t = tdf.data[-1]
208217
if t.NAME not in self._columns:

0 commit comments

Comments
 (0)