improve logger

This commit is contained in:
Stefan Allius
2024-05-09 14:19:37 +02:00
parent a869ead89a
commit 41d9a2a1ef
2 changed files with 4 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ class InfosG3P(Infos):
if res:
yield res
def parse(self, buf, msg_type: int, rcv_ftype: int) \
def parse(self, buf, msg_type: int, rcv_ftype: int, node_id: str = '') \
-> Generator[tuple[str, bool], None, None]:
'''parse a data sequence received from the inverter and
stores the values in Infos.db
@@ -123,4 +123,5 @@ class InfosG3P(Infos):
update = False
if update:
self.tracer.log(level, f'GEN3PLUS: {name} : {result}{unit}')
self.tracer.log(level, f'[\'{node_id}\']GEN3PLUS: {name}'
f' : {result}{unit}')

View File

@@ -142,7 +142,7 @@ class Modbus():
yield keys[0], update, result
if update:
info_db.tracer.log(level,
f'MODBUS[{node_id}]: {name}'
f'[\'{node_id}\']MODBUS: {name}'
f' : {result}{unit}')
def check_crc(self, msg) -> bool: