Skip to content

Commit

Permalink
Eliminate more implicit optional (#1871)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 authored Oct 30, 2023
1 parent 1c96d93 commit 8b63dd2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion pymodbus/client/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def __init__(
**kwargs: Any,
) -> None:
"""Initialize Modbus Serial Client."""
self.transport = None
kwargs["use_sync"] = True
super().__init__(
framer,
Expand Down
3 changes: 1 addition & 2 deletions pymodbus/client/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def __init__(
if "CommType" not in kwargs:
kwargs["CommType"] = CommType.TCP
kwargs["use_sync"] = True
self.transport = None
super().__init__(
framer,
host=host,
Expand All @@ -160,7 +159,7 @@ def __init__(
self.socket = None

@property
def connected(self):
def connected(self) -> bool:
"""Connect internal."""
return self.socket is not None

Expand Down
3 changes: 1 addition & 2 deletions pymodbus/client/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def __init__(
**kwargs: Any,
):
"""Initialize Modbus TLS Client."""
self.transport = None
super().__init__(
host, CommType=CommType.TLS, port=port, framer=framer, **kwargs
)
Expand All @@ -166,7 +165,7 @@ def __init__(
self.params.server_hostname = server_hostname

@property
def connected(self):
def connected(self) -> bool:
"""Connect internal."""
return self.transport is not None

Expand Down
3 changes: 1 addition & 2 deletions pymodbus/client/udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def __init__(
) -> None:
"""Initialize Modbus UDP Client."""
kwargs["use_sync"] = True
self.transport = None
super().__init__(
framer,
port=port,
Expand All @@ -164,7 +163,7 @@ def __init__(
self.socket = None

@property
def connected(self):
def connected(self) -> bool:
"""Connect internal."""
return self.socket is not None

Expand Down

0 comments on commit 8b63dd2

Please sign in to comment.