change log level for some traces
This commit is contained in:
@@ -141,8 +141,8 @@ class Talent(Message):
|
|||||||
|
|
||||||
def send_modbus_cb(self, modbus_pdu: bytearray, log_lvl: int, state: str):
|
def send_modbus_cb(self, modbus_pdu: bytearray, log_lvl: int, state: str):
|
||||||
if self.state != self.STATE_UP:
|
if self.state != self.STATE_UP:
|
||||||
logger.warn(f'[{self.node_id}] ignore MODBUS cmd,'
|
logger.debug(f'[{self.node_id}] ignore MODBUS cmd,'
|
||||||
' as the state is not UP')
|
' as the state is not UP')
|
||||||
return
|
return
|
||||||
|
|
||||||
self.__build_header(0x70, 0x77)
|
self.__build_header(0x70, 0x77)
|
||||||
@@ -158,8 +158,8 @@ class Talent(Message):
|
|||||||
|
|
||||||
async def send_modbus_cmd(self, func, addr, val, log_lvl) -> None:
|
async def send_modbus_cmd(self, func, addr, val, log_lvl) -> None:
|
||||||
if self.state != self.STATE_UP:
|
if self.state != self.STATE_UP:
|
||||||
logger.warn(f'[{self.node_id}] ignore MODBUS cmd,'
|
logger.debug(f'[{self.node_id}] ignore MODBUS cmd,'
|
||||||
' as the state is not UP')
|
' as the state is not UP')
|
||||||
return
|
return
|
||||||
self.mb.build_msg(Modbus.INV_ADDR, func, addr, val, log_lvl)
|
self.mb.build_msg(Modbus.INV_ADDR, func, addr, val, log_lvl)
|
||||||
|
|
||||||
|
|||||||
@@ -339,8 +339,8 @@ class SolarmanV5(Message):
|
|||||||
|
|
||||||
def send_modbus_cb(self, pdu: bytearray, log_lvl: int, state: str):
|
def send_modbus_cb(self, pdu: bytearray, log_lvl: int, state: str):
|
||||||
if self.state != self.STATE_UP:
|
if self.state != self.STATE_UP:
|
||||||
logger.warn(f'[{self.node_id}] ignore MODBUS cmd,'
|
logger.debug(f'[{self.node_id}] ignore MODBUS cmd,'
|
||||||
' as the state is not UP')
|
' as the state is not UP')
|
||||||
return
|
return
|
||||||
self.__build_header(0x4510)
|
self.__build_header(0x4510)
|
||||||
self._send_buffer += struct.pack('<BHLLL', self.MB_RTU_CMD,
|
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:
|
async def send_modbus_cmd(self, func, addr, val, log_lvl) -> None:
|
||||||
if self.state != self.STATE_UP:
|
if self.state != self.STATE_UP:
|
||||||
logger.warn(f'[{self.node_id}] ignore MODBUS cmd,'
|
logger.debug(f'[{self.node_id}] ignore MODBUS cmd,'
|
||||||
' as the state is not UP')
|
' as the state is not UP')
|
||||||
return
|
return
|
||||||
self.mb.build_msg(Modbus.INV_ADDR, func, addr, val, log_lvl)
|
self.mb.build_msg(Modbus.INV_ADDR, func, addr, val, log_lvl)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user