Skip to content

Commit 74bab4c

Browse files
committed
improve port logic
1 parent e511768 commit 74bab4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

e3dc/_e3dc_rscp_local.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ._rscpLib import RscpMessage, rscpDecode, rscpEncode, rscpFrame
1111
from ._rscpTags import RscpError, RscpTag, RscpType
1212

13-
PORT = 5033
13+
DEFAULT_PORT = 5033
1414
BUFFER_SIZE = 1024 * 32
1515

1616

@@ -42,7 +42,7 @@ class E3DC_RSCP_local:
4242
"""A class describing an E3DC system connection using RSCP protocol locally."""
4343

4444
def __init__(
45-
self, username: str, password: str, ip: str, key: str, port: int | None = PORT
45+
self, username: str, password: str, ip: str, key: str, port: int | None = None
4646
):
4747
"""Constructor of an E3DC RSCP local object.
4848
@@ -56,7 +56,7 @@ def __init__(
5656
self.username = username.encode("utf-8")
5757
self.password = password.encode("utf-8")
5858
self.ip = ip
59-
self.port = port if port else PORT
59+
self.port = port or DEFAULT_PORT
6060
self.key = key.encode("utf-8")
6161
self.socket: socket.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
6262
self.connected: bool = False

0 commit comments

Comments
 (0)