Formatting and a pyright fix for the new config

This commit is contained in:
Jack Kingsman
2026-01-17 19:25:55 -08:00
parent 66e98c41fd
commit 763e5787a6
2 changed files with 7 additions and 18 deletions

View File

@@ -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

View File

@@ -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")