improve logger
This commit is contained in:
@@ -88,7 +88,7 @@ class InfosG3P(Infos):
|
|||||||
if res:
|
if res:
|
||||||
yield 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]:
|
-> Generator[tuple[str, bool], None, None]:
|
||||||
'''parse a data sequence received from the inverter and
|
'''parse a data sequence received from the inverter and
|
||||||
stores the values in Infos.db
|
stores the values in Infos.db
|
||||||
@@ -123,4 +123,5 @@ class InfosG3P(Infos):
|
|||||||
update = False
|
update = False
|
||||||
|
|
||||||
if update:
|
if update:
|
||||||
self.tracer.log(level, f'GEN3PLUS: {name} : {result}{unit}')
|
self.tracer.log(level, f'[\'{node_id}\']GEN3PLUS: {name}'
|
||||||
|
f' : {result}{unit}')
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class Modbus():
|
|||||||
yield keys[0], update, result
|
yield keys[0], update, result
|
||||||
if update:
|
if update:
|
||||||
info_db.tracer.log(level,
|
info_db.tracer.log(level,
|
||||||
f'MODBUS[{node_id}]: {name}'
|
f'[\'{node_id}\']MODBUS: {name}'
|
||||||
f' : {result}{unit}')
|
f' : {result}{unit}')
|
||||||
|
|
||||||
def check_crc(self, msg) -> bool:
|
def check_crc(self, msg) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user