Handle explicit Modbus NaN values (#90800)
Co-authored-by: jan iversen <jancasacondor@gmail.com>
This commit is contained in:
parent
0511071757
commit
c4a5373976
6 changed files with 57 additions and 2 deletions
|
@ -9,6 +9,7 @@ from homeassistant.components.modbus.const import (
|
|||
CONF_LAZY_ERROR,
|
||||
CONF_MAX_VALUE,
|
||||
CONF_MIN_VALUE,
|
||||
CONF_NAN_VALUE,
|
||||
CONF_PRECISION,
|
||||
CONF_SCALE,
|
||||
CONF_SLAVE_COUNT,
|
||||
|
@ -558,6 +559,15 @@ async def test_config_wrong_struct_sensor(
|
|||
False,
|
||||
str(int(0x02010404)),
|
||||
),
|
||||
(
|
||||
{
|
||||
CONF_DATA_TYPE: DataType.INT32,
|
||||
CONF_NAN_VALUE: "0x80000000",
|
||||
},
|
||||
[0x8000, 0x0000],
|
||||
False,
|
||||
STATE_UNAVAILABLE,
|
||||
),
|
||||
(
|
||||
{
|
||||
CONF_DATA_TYPE: DataType.INT32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue