Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions pymodbus/client/asynchronous/factory/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,3 @@ def async_io_factory(port=None, framer=None, **kwargs):
future.result()

return loop, client


def get_factory():
"""Get protocol factory.

:return: new factory
"""
return async_io_factory
8 changes: 0 additions & 8 deletions pymodbus/client/asynchronous/factory/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,3 @@ def async_io_factory(host="127.0.0.1", port=Defaults.Port, **kwargs):
client = future.result()

return loop, client


def get_factory():
"""Get protocol factory.

:return: new factory
"""
return async_io_factory
8 changes: 0 additions & 8 deletions pymodbus/client/asynchronous/factory/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,3 @@ def async_io_factory(
client = future.result()

return loop, client


def get_factory():
"""Get protocol factory.

:return: protocol object
"""
return async_io_factory
8 changes: 0 additions & 8 deletions pymodbus/client/asynchronous/factory/udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,3 @@ def async_io_factory(host="127.0.0.1", port=Defaults.Port, **kwargs):
client = client.result()

return loop, client


def get_factory():
"""Get protocol factory.

:return: new factory
"""
return async_io_factory
5 changes: 2 additions & 3 deletions pymodbus/client/asynchronous/serial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""SERIAL communication."""
import logging

from pymodbus.client.asynchronous.factory.serial import get_factory
from pymodbus.client.asynchronous.factory.serial import async_io_factory
from pymodbus.exceptions import ParameterException
from pymodbus.factory import ClientDecoder
from pymodbus.transaction import (
Expand Down Expand Up @@ -58,7 +58,6 @@ def __new__(cls, method, port, **kwargs):
:param kwargs:
:return:
"""
factory_class = get_factory()
framer = cls._framer(method)
yieldable = factory_class(framer=framer, port=port, **kwargs)
yieldable = async_io_factory(framer=framer, port=port, **kwargs)
return yieldable
5 changes: 2 additions & 3 deletions pymodbus/client/asynchronous/tcp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""TCP communication."""
import logging

from pymodbus.client.asynchronous.factory.tcp import get_factory
from pymodbus.client.asynchronous.factory.tcp import async_io_factory
from pymodbus.constants import Defaults

_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -33,8 +33,7 @@ def __new__(
:param kwargs: Other extra args specific to Backend being used
:return:
"""
factory_class = get_factory()
yieldable = factory_class(
yieldable = async_io_factory(
host=host,
port=port,
framer=framer,
Expand Down
5 changes: 2 additions & 3 deletions pymodbus/client/asynchronous/tls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""TLS communication."""
import logging

from pymodbus.client.asynchronous.factory.tls import get_factory
from pymodbus.client.asynchronous.factory.tls import async_io_factory
from pymodbus.constants import Defaults
from pymodbus.factory import ClientDecoder
from pymodbus.transaction import ModbusTlsFramer
Expand Down Expand Up @@ -44,8 +44,7 @@ def __new__(
:return:
"""
framer = framer or ModbusTlsFramer(ClientDecoder())
factory_class = get_factory()
yieldable = factory_class(
yieldable = async_io_factory(
host=host,
port=port,
sslctx=sslctx,
Expand Down
5 changes: 2 additions & 3 deletions pymodbus/client/asynchronous/udp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""UDP communication."""
import logging

from pymodbus.client.asynchronous.factory.udp import get_factory
from pymodbus.client.asynchronous.factory.udp import async_io_factory
from pymodbus.constants import Defaults

_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -33,8 +33,7 @@ def __new__(
:param kwargs: Other extra args specific to Backend being used
:return:
"""
factory_class = get_factory()
yieldable = factory_class(
yieldable = async_io_factory(
host=host,
port=port,
framer=framer,
Expand Down