From 763e5787a670e67db2fed8ec036cb5be932f676b Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sat, 17 Jan 2026 19:25:55 -0800 Subject: [PATCH] Formatting and a pyright fix for the new config --- app/config.py | 5 ++--- app/event_handlers.py | 20 +++++--------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/app/config.py b/app/config.py index 5646c8e..83b18ba 100644 --- a/app/config.py +++ b/app/config.py @@ -1,12 +1,11 @@ import logging from typing import Literal -from pydantic import ConfigDict -from pydantic_settings import BaseSettings +from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): - model_config = ConfigDict(env_prefix="MESHCORE_") + model_config = SettingsConfigDict(env_prefix="MESHCORE_") serial_port: str = "" # Empty string triggers auto-detection serial_baudrate: int = 115200 diff --git a/app/event_handlers.py b/app/event_handlers.py index 5d62831..32f2bfd 100644 --- a/app/event_handlers.py +++ b/app/event_handlers.py @@ -221,19 +221,9 @@ def register_event_handlers(meshcore) -> None: _active_subscriptions.clear() # Register handlers and track subscriptions - _active_subscriptions.append( - meshcore.subscribe(EventType.CONTACT_MSG_RECV, on_contact_message) - ) - _active_subscriptions.append( - meshcore.subscribe(EventType.RX_LOG_DATA, on_rx_log_data) - ) - _active_subscriptions.append( - meshcore.subscribe(EventType.PATH_UPDATE, on_path_update) - ) - _active_subscriptions.append( - meshcore.subscribe(EventType.NEW_CONTACT, on_new_contact) - ) - _active_subscriptions.append( - meshcore.subscribe(EventType.ACK, on_ack) - ) + _active_subscriptions.append(meshcore.subscribe(EventType.CONTACT_MSG_RECV, on_contact_message)) + _active_subscriptions.append(meshcore.subscribe(EventType.RX_LOG_DATA, on_rx_log_data)) + _active_subscriptions.append(meshcore.subscribe(EventType.PATH_UPDATE, on_path_update)) + _active_subscriptions.append(meshcore.subscribe(EventType.NEW_CONTACT, on_new_contact)) + _active_subscriptions.append(meshcore.subscribe(EventType.ACK, on_ack)) logger.info("Event handlers registered")