pull/1/head
Jeremiah K 2023-06-08 17:41:03 -05:00
rodzic 4b827bd9f2
commit 81841c1fe4
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -110,7 +110,7 @@ def save_shortname(meshtastic_id, shortname):
)
conn.commit()
def update_shortnames(nodes):
def update_shortname(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, update_shortnames
from db_utils import initialize_database, update_longnames, update_shortname
from matrix_utils import (
connect_matrix,
join_matrix_room,
@ -28,6 +28,7 @@ from meshtastic_utils import (
logger = get_logger(name="M<>M Relay")
meshtastic_interface = connect_meshtastic()
logger.debug(f"meshtastic_interface: {meshtastic_interface}")
matrix_rooms: List[dict] = relay_config["matrix_rooms"]
matrix_access_token = relay_config["matrix"]["access_token"]
@ -72,7 +73,7 @@ async def main():
try:
# Update longnames & shortnames
update_longnames(meshtastic_interface.nodes)
update_shortnames(meshtastic_interface.nodes)
update_shortname(meshtastic_interface.nodes)
matrix_logger.info("Syncing with server...")
await matrix_client.sync_forever(timeout=30000)