forked from home-assistant/core
Change Modbus error message to bytes (#50725)
This commit is contained in:
@@ -142,11 +142,13 @@ async def async_setup_platform(
|
|||||||
_LOGGER.error("Error in sensor %s structure: %s", entry[CONF_NAME], err)
|
_LOGGER.error("Error in sensor %s structure: %s", entry[CONF_NAME], err)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if entry[CONF_COUNT] * 2 != size:
|
bytecount = entry[CONF_COUNT] * 2
|
||||||
|
if bytecount != size:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Structure size (%d bytes) mismatch registers count (%d words)",
|
"Structure request %d bytes, but %d registers have a size of %d bytes",
|
||||||
size,
|
size,
|
||||||
entry[CONF_COUNT],
|
entry[CONF_COUNT],
|
||||||
|
bytecount,
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user