mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-05-21 23:24:44 +02:00
fix: Add node_num property to NodeHealth class
NodeHealth stored node_id as hex string but mesh_reporter.py expected node_num integer. Added computed property to convert.
This commit is contained in:
parent
cb61c4199c
commit
e9ddfa7e26
1 changed files with 7 additions and 0 deletions
|
|
@ -124,6 +124,13 @@ class NodeHealth:
|
|||
# Scores
|
||||
score: HealthScore = field(default_factory=HealthScore)
|
||||
|
||||
@property
|
||||
def node_num(self) -> int:
|
||||
"""Convert node_id hex string to integer."""
|
||||
if self.node_id.startswith("!"):
|
||||
return int(self.node_id[1:], 16)
|
||||
return int(self.node_id, 16)
|
||||
|
||||
@property
|
||||
def non_text_packets(self) -> int:
|
||||
"""Non-text packets in 24h."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue