mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-03-30 12:05:38 +00:00
- 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.
27 lines
768 B
Python
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
|