mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-03-28 17:43:05 +01:00
Formatting and a pyright fix for the new config
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user