mirror of
https://github.com/tcivie/meshtastic-metrics-exporter.git
synced 2025-03-05 20:52:02 -08:00
Fix wrong port_name decoding
This commit is contained in:
parent
aebb5a0456
commit
d54315a32d
|
@ -138,9 +138,10 @@ class MessageProcessor:
|
||||||
processor.process(payload, client_details=source_client_details)
|
processor.process(payload, client_details=source_client_details)
|
||||||
|
|
||||||
def get_port_name_from_portnum(self, port_num):
|
def get_port_name_from_portnum(self, port_num):
|
||||||
for name, value in PortNum.__dict__.items():
|
descriptor = PortNum.DESCRIPTOR
|
||||||
if isinstance(value, int) and value == port_num:
|
for enum_value in descriptor.values:
|
||||||
return name
|
if enum_value.number == port_num:
|
||||||
|
return enum_value.name
|
||||||
return 'UNKNOWN_PORT'
|
return 'UNKNOWN_PORT'
|
||||||
|
|
||||||
def process_simple_packet_details(self, destination_client_details, mesh_packet, port_num, source_client_details):
|
def process_simple_packet_details(self, destination_client_details, mesh_packet, port_num, source_client_details):
|
||||||
|
|
Loading…
Reference in a new issue