mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-07 02:11:22 +02:00
Formatting and a pyright fix for the new config
This commit is contained in:
+2
-3
@@ -1,12 +1,11 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
|
||||||
from pydantic import ConfigDict
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||||
from pydantic_settings import BaseSettings
|
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
model_config = ConfigDict(env_prefix="MESHCORE_")
|
model_config = SettingsConfigDict(env_prefix="MESHCORE_")
|
||||||
|
|
||||||
serial_port: str = "" # Empty string triggers auto-detection
|
serial_port: str = "" # Empty string triggers auto-detection
|
||||||
serial_baudrate: int = 115200
|
serial_baudrate: int = 115200
|
||||||
|
|||||||
+5
-15
@@ -221,19 +221,9 @@ def register_event_handlers(meshcore) -> None:
|
|||||||
_active_subscriptions.clear()
|
_active_subscriptions.clear()
|
||||||
|
|
||||||
# Register handlers and track subscriptions
|
# Register handlers and track subscriptions
|
||||||
_active_subscriptions.append(
|
_active_subscriptions.append(meshcore.subscribe(EventType.CONTACT_MSG_RECV, on_contact_message))
|
||||||
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(
|
_active_subscriptions.append(meshcore.subscribe(EventType.NEW_CONTACT, on_new_contact))
|
||||||
meshcore.subscribe(EventType.RX_LOG_DATA, on_rx_log_data)
|
_active_subscriptions.append(meshcore.subscribe(EventType.ACK, on_ack))
|
||||||
)
|
|
||||||
_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")
|
logger.info("Event handlers registered")
|
||||||
|
|||||||
Reference in New Issue
Block a user