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
|
|
@ -125,6 +125,13 @@ class NodeHealth:
|
||||||
score: HealthScore = field(default_factory=HealthScore)
|
score: HealthScore = field(default_factory=HealthScore)
|
||||||
|
|
||||||
@property
|
@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:
|
def non_text_packets(self) -> int:
|
||||||
"""Non-text packets in 24h."""
|
"""Non-text packets in 24h."""
|
||||||
return self.packet_count_24h - self.text_packet_count_24h
|
return self.packet_count_24h - self.text_packet_count_24h
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue