mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +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.constants import Defaults
|
||||
from pymodbus.exceptions import ModbusException
|
||||
from pymodbus.transaction import ModbusRtuFramer
|
||||
|
||||
from homeassistant.const import (
|
||||
CONF_DELAY,
|
||||
@ -224,7 +225,7 @@ class ModbusHub:
|
||||
# network configuration
|
||||
self._pb_params["host"] = client_config[CONF_HOST]
|
||||
if self._config_type == CONF_RTUOVERTCP:
|
||||
self._pb_params["host"] = "ModbusRtuFramer"
|
||||
self._pb_params["framer"] = ModbusRtuFramer
|
||||
|
||||
Defaults.Timeout = client_config[CONF_TIMEOUT]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user