@@ -383,7 +383,7 @@ async def async_dhcp_check_device_types(self, host, port=DEFAULT_PORT, timeout=1
383
383
client = AsyncModbusTcpClient (host = host , port = port , timeout = timeout )
384
384
385
385
try :
386
- with _suppress_pymodbus_logging ():
386
+ with _suppress_pymodbus_logging (really_suppress = False if _LOGGER . isEnabledFor ( logging . DEBUG ) else True ):
387
387
if not await client .connect ():
388
388
_LOGGER .debug ("Modbus connection failed to %s:%s" , host , port )
389
389
return False
@@ -582,7 +582,7 @@ async def _async_try_read_register(self, client: AsyncModbusTcpClient, slave_id:
582
582
host = client .comm_params .host
583
583
port = client .comm_params .port
584
584
585
- with _suppress_pymodbus_logging ():
585
+ with _suppress_pymodbus_logging (really_suppress = False if _LOGGER . isEnabledFor ( logging . DEBUG ) else True ):
586
586
if not await client .connect ():
587
587
err = ("Modbus connection failed to %s:%s" % (host , port ))
588
588
_LOGGER .debug (err )
@@ -625,7 +625,7 @@ async def async_check_device_type(self, host, port, slave_id, timeout=1) -> str:
625
625
client = AsyncModbusTcpClient (host = host , port = port , timeout = timeout )
626
626
627
627
try :
628
- with _suppress_pymodbus_logging ():
628
+ with _suppress_pymodbus_logging (really_suppress = False if _LOGGER . isEnabledFor ( logging . DEBUG ) else True ):
629
629
if not await client .connect ():
630
630
_LOGGER .debug ("Modbus connection failed to %s:%s" , host , port )
631
631
return DEVICE_TYPE_UNKNOWN # Cannot determine type if connection fails
0 commit comments