kopia lustrzana https://github.com/mate-dev/meshtastic-matrix-relay
More shortname work
rodzic
e3818a5bc7
commit
58cb9a00d4
|
@ -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")
|
||||
|
|
3
main.py
3
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
|
||||
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)
|
||||
|
|
Ładowanie…
Reference in New Issue