diff --git a/db_utils.py b/db_utils.py index 1a8e532..fc0c236 100644 --- a/db_utils.py +++ b/db_utils.py @@ -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") diff --git a/main.py b/main.py index 0519cb4..af1b2b7 100644 --- a/main.py +++ b/main.py @@ -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)