More shortname work

pull/1/head
Jeremiah K 2023-06-08 17:18:12 -05:00
rodzic e3818a5bc7
commit 58cb9a00d4
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -110,7 +110,7 @@ def save_shortname(meshtastic_id, shortname):
)
conn.commit()
def update_shortnames():
def update_shortnames(nodes):
if meshtastic_interface.nodes:
for node in meshtastic_interface.nodes.values():
user = node.get("user")

Wyświetl plik

@ -9,7 +9,7 @@ from nio import (
)
from pubsub import pub
from typing import List
from db_utils import initialize_database, update_longnames
from db_utils import initialize_database, update_longnames, update_shortnames
from matrix_utils import (
connect_matrix,
join_matrix_room,
@ -72,6 +72,7 @@ async def main():
try:
# Update longnames
update_longnames(meshtastic_interface.nodes)
update_shortnames(meshtastic_interface.nodes)
matrix_logger.info("Syncing with server...")
await matrix_client.sync_forever(timeout=30000)