mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Fix MODBUS connection type rtuovertcp does not connect (#52505)
* Correct host -> framer. * Use function pointer
This commit is contained in:
parent
2e4f513526
commit
1cb298948f
@ -5,6 +5,7 @@ import logging
|
|||||||
from pymodbus.client.sync import ModbusSerialClient, ModbusTcpClient, ModbusUdpClient
|
from pymodbus.client.sync import ModbusSerialClient, ModbusTcpClient, ModbusUdpClient
|
||||||
from pymodbus.constants import Defaults
|
from pymodbus.constants import Defaults
|
||||||
from pymodbus.exceptions import ModbusException
|
from pymodbus.exceptions import ModbusException
|
||||||
|
from pymodbus.transaction import ModbusRtuFramer
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_DELAY,
|
CONF_DELAY,
|
||||||
@ -224,7 +225,7 @@ class ModbusHub:
|
|||||||
# network configuration
|
# network configuration
|
||||||
self._pb_params["host"] = client_config[CONF_HOST]
|
self._pb_params["host"] = client_config[CONF_HOST]
|
||||||
if self._config_type == CONF_RTUOVERTCP:
|
if self._config_type == CONF_RTUOVERTCP:
|
||||||
self._pb_params["host"] = "ModbusRtuFramer"
|
self._pb_params["framer"] = ModbusRtuFramer
|
||||||
|
|
||||||
Defaults.Timeout = client_config[CONF_TIMEOUT]
|
Defaults.Timeout = client_config[CONF_TIMEOUT]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user