beautify some traces

This commit is contained in:
Stefan Allius
2024-06-07 19:27:36 +02:00
parent c59bd16664
commit 0b2631c162
4 changed files with 16 additions and 14 deletions

View File

@@ -339,8 +339,8 @@ class SolarmanV5(Message):
def send_modbus_cb(self, pdu: bytearray, log_lvl: int, state: str):
if self.state != self.STATE_UP:
logger.debug(f'[{self.node_id}] ignore MODBUS cmd,'
' as the state is not UP')
logger.warn(f'[{self.node_id}] ignore MODBUS cmd,'
' cause the state is not UP anymore')
return
self.__build_header(0x4510)
self._send_buffer += struct.pack('<BHLLL', self.MB_RTU_CMD,
@@ -354,8 +354,8 @@ class SolarmanV5(Message):
async def send_modbus_cmd(self, func, addr, val, log_lvl) -> None:
if self.state != self.STATE_UP:
logger.debug(f'[{self.node_id}] ignore MODBUS cmd,'
' as the state is not UP')
logger.log(log_lvl, f'[{self.node_id}] ignore MODBUS cmd,'
' as the state is not UP')
return
self.mb.build_msg(Modbus.INV_ADDR, func, addr, val, log_lvl)