Files
meshcore-bot/modules/models.py
agessaman 7d76ed443b Update dependencies and enhance path handling for multi-byte support
- Updated `meshcore` dependency version to `2.2.14` in both `pyproject.toml` and `requirements.txt`.
- Added multi-byte path support in the `PathCommand`, allowing for 1-, 2-, and 3-byte-per-hop paths.
- Enhanced `MessageHandler` to utilize `routing_info` for accurate path extraction and validation.
- Improved path extraction methods in `MultitestCommand` and `TestCommand` to prefer `routing_info` for node IDs.
- Refactored path handling logic across various commands to ensure consistent multi-byte path processing.
2026-03-05 13:37:38 -08:00

27 lines
768 B
Python

#!/usr/bin/env python3
"""
Data models for the MeshCore Bot
Contains shared data structures used across modules
"""
from dataclasses import dataclass
from typing import Any, Dict, Optional
@dataclass
class MeshMessage:
"""Simplified message structure for our bot"""
content: str
sender_id: Optional[str] = None
sender_pubkey: Optional[str] = None
channel: Optional[str] = None
hops: Optional[int] = None
path: Optional[str] = None
is_dm: bool = False
timestamp: Optional[int] = None
snr: Optional[float] = None
rssi: Optional[int] = None
elapsed: Optional[str] = None
# When set from RF routing: path_nodes, path_hex, bytes_per_hop, path_length, route_type, etc.
routing_info: Optional[Dict[str, Any]] = None