Skip to content

Commit 1265a8a

Browse files
committed
replace Optional in docstrings
1 parent 1cdb9f7 commit 1265a8a

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

e3dc/_e3dc.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self, connectType: int, **kwargs: Any) -> None:
7474
key (str): encryption key as set in the E3DC settings - required for CONNECT_LOCAL
7575
serialNumber (str): the serial number of the system to monitor - required for CONNECT_WEB
7676
isPasswordMd5 (bool): indicates whether the password is already md5 digest (recommended, default = True) - required for CONNECT_WEB
77-
configuration (Optional[dict]): dict containing details of the E3DC configuration. {"pvis": [{"index": 0, "strings": 2, "phases": 3}], "powermeters": [{"index": 0}], "batteries": [{"index": 0, "dcbs": 1}]}
77+
configuration (dict | None): dict containing details of the E3DC configuration. {"pvis": [{"index": 0, "strings": 2, "phases": 3}], "powermeters": [{"index": 0}], "batteries": [{"index": 0, "dcbs": 1}]}
7878
port (int, optional): port number for local connection. Defaults to None, which means default port 5033 is used.
7979
"""
8080
self.connectType = connectType
@@ -994,8 +994,8 @@ def get_wallbox_data(self, wbIndex: int = 0, keepAlive: bool = False):
994994
"""Polls the wallbox status via rscp protocol locally.
995995
996996
Args:
997-
wbIndex (Optional[int]): Index of the wallbox to poll data for
998-
keepAlive (Optional[bool]): True to keep connection alive
997+
wbIndex (int | None): Index of the wallbox to poll data for
998+
keepAlive (bool | None): True to keep connection alive
999999
10001000
Returns:
10011001
dict: Dictionary containing the wallbox status structured as follows::
@@ -1093,8 +1093,8 @@ def set_wallbox_sunmode(
10931093
10941094
Args:
10951095
enable (bool): True to enable sun mode, otherwise false,
1096-
wbIndex (Optional[int]): index of the requested wallbox,
1097-
keepAlive (Optional[bool]): True to keep connection alive
1096+
wbIndex (int | None): index of the requested wallbox,
1097+
keepAlive (bool | None): True to keep connection alive
10981098
10991099
Returns:
11001100
True if success
@@ -1111,8 +1111,8 @@ def set_wallbox_schuko(
11111111
11121112
Args:
11131113
on (bool): True to activate the Schuko, otherwise false
1114-
wbIndex (Optional[int]): index of the requested wallbox,
1115-
keepAlive (Optional[bool]): True to keep connection alive
1114+
wbIndex (int | None): index of the requested wallbox,
1115+
keepAlive (bool | None): True to keep connection alive
11161116
11171117
Returns:
11181118
True if success (wallbox has understood the request, but might have ignored an unsupported value)
@@ -1129,8 +1129,8 @@ def set_wallbox_max_charge_current(
11291129
11301130
Args:
11311131
max_charge_current (int): maximum allowed charge current in A
1132-
wbIndex (Optional[int]): index of the requested wallbox,
1133-
keepAlive (Optional[bool]): True to keep connection alive
1132+
wbIndex (int | None): index of the requested wallbox,
1133+
keepAlive (bool | None): True to keep connection alive
11341134
11351135
Returns:
11361136
True if success (wallbox has understood the request, but might have clipped the value)
@@ -1150,8 +1150,8 @@ def toggle_wallbox_charging(
11501150
"""Toggles charging of the wallbox via rscp protocol locally.
11511151
11521152
Args:
1153-
wbIndex (Optional[int]): index of the requested wallbox,
1154-
keepAlive (Optional[bool]): True to keep connection alive
1153+
wbIndex (int | None): index of the requested wallbox,
1154+
keepAlive (bool | None): True to keep connection alive
11551155
11561156
Returns:
11571157
True if success
@@ -1165,8 +1165,8 @@ def toggle_wallbox_phases(self, wbIndex: int = 0, keepAlive: bool = False) -> bo
11651165
"""Toggles the number of phases used for charging by the wallbox between 1 and 3 via rscp protocol locally.
11661166
11671167
Args:
1168-
wbIndex (Optional[int]): index of the requested wallbox,
1169-
keepAlive (Optional[bool]): True to keep connection alive
1168+
wbIndex (int | None): index of the requested wallbox,
1169+
keepAlive (bool | None): True to keep connection alive
11701170
11711171
Returns:
11721172
True if success
@@ -1189,9 +1189,9 @@ def sendWallboxRequest(
11891189
Args:
11901190
dataIndex (int): byte index in the WB_EXTERN_DATA array (values: 0-5)
11911191
value (int): byte value to be set in the WB_EXTERN_DATA array at the given index
1192-
request (Optional[RscpTag]): request identifier (WB_REQ_SET_EXTERN, WB_REQ_SET_PARAM_1 or WB_REQ_SET_PARAM_2),
1193-
wbIndex (Optional[int]): index of the requested wallbox,
1194-
keepAlive (Optional[bool]): True to keep connection alive
1192+
request (RscpTag | None): request identifier (WB_REQ_SET_EXTERN, WB_REQ_SET_PARAM_1 or WB_REQ_SET_PARAM_2),
1193+
wbIndex (int | None): index of the requested wallbox,
1194+
keepAlive (bool | None): True to keep connection alive
11951195
11961196
Returns:
11971197
An object with the received data
@@ -1235,9 +1235,9 @@ def sendWallboxSetRequest(
12351235
Args:
12361236
dataIndex (int): byte index in the WB_EXTERN_DATA array (values: 0-5)
12371237
value (int): byte value to be set in the WB_EXTERN_DATA array at the given index
1238-
request (Optional[RscpTag]): request identifier (WB_REQ_SET_EXTERN, WB_REQ_SET_PARAM_1 or WB_REQ_SET_PARAM_2),
1239-
wbIndex (Optional[int]): index of the requested wallbox,
1240-
keepAlive (Optional[bool]): True to keep connection alive
1238+
request (RscpTag | None): request identifier (WB_REQ_SET_EXTERN, WB_REQ_SET_PARAM_1 or WB_REQ_SET_PARAM_2),
1239+
wbIndex (int | None): index of the requested wallbox,
1240+
keepAlive (bool | None): True to keep connection alive
12411241
12421242
Returns:
12431243
True if success
@@ -1260,7 +1260,7 @@ def set_battery_to_car_mode(self, enabled: bool, keepAlive: bool = False):
12601260
12611261
Args:
12621262
enabled (bool): True to enable charging the car using the battery
1263-
keepAlive (Optional[bool]): True to keep connection alive
1263+
keepAlive (bool | None): True to keep connection alive
12641264
12651265
Returns:
12661266
True if success
@@ -1330,8 +1330,8 @@ def get_battery_data(
13301330
"""Polls the battery data via rscp protocol.
13311331
13321332
Args:
1333-
batIndex (Optional[int]): battery index
1334-
dcbs (Optional[list]): dcb list
1333+
batIndex (int | None): battery index
1334+
dcbs (list | None): dcb list
13351335
keepAlive (bool): True to keep connection alive. Defaults to False.
13361336
13371337
Returns:
@@ -1658,7 +1658,7 @@ def get_batteries_data(
16581658
"""Polls the batteries data via rscp protocol.
16591659
16601660
Args:
1661-
batteries (Optional[dict]): batteries dict
1661+
batteries (dict | None): batteries dict
16621662
keepAlive (bool): True to keep connection alive. Defaults to False.
16631663
16641664
Returns:
@@ -1749,8 +1749,8 @@ def get_pvi_data(
17491749
17501750
Args:
17511751
pviIndex (int): pv inverter index
1752-
strings (Optional[list]): string list
1753-
phases (Optional[list]): phase list
1752+
strings (list | None): string list
1753+
phases (list | None): phase list
17541754
keepAlive (bool): True to keep connection alive. Defaults to False.
17551755
17561756
Returns:
@@ -2043,7 +2043,7 @@ def get_pvis_data(
20432043
"""Polls the inverters data via rscp protocol.
20442044
20452045
Args:
2046-
pvis (Optional[dict]): pvis dict
2046+
pvis (dict | None): pvis dict
20472047
keepAlive (bool): True to keep connection alive. Defaults to False.
20482048
20492049
Returns:
@@ -2126,7 +2126,7 @@ def get_powermeter_data(self, pmIndex: int | None = None, keepAlive: bool = Fals
21262126
"""Polls the power meter data via rscp protocol.
21272127
21282128
Args:
2129-
pmIndex (Optional[int]): power meter index
2129+
pmIndex (int | None): power meter index
21302130
keepAlive (bool): True to keep connection alive. Defaults to False.
21312131
21322132
Returns:
@@ -2215,7 +2215,7 @@ def get_powermeters_data(
22152215
"""Polls the powermeters data via rscp protocol.
22162216
22172217
Args:
2218-
powermeters (Optional[dict]): powermeters dict
2218+
powermeters (dict | None): powermeters dict
22192219
keepAlive (bool): True to keep connection alive. Defaults to False.
22202220
22212221
Returns:
@@ -2297,9 +2297,9 @@ def set_power_limits(
22972297
22982298
Args:
22992299
enable (bool): True/False
2300-
max_charge (Optional[int]): maximum charge power
2301-
max_discharge (Optional[int]: maximum discharge power
2302-
discharge_start (Optional[int]: power where discharged is started
2300+
max_charge (int | None): maximum charge power
2301+
max_discharge (int | None): maximum discharge power
2302+
discharge_start (int | None): power where discharged is started
23032303
keepAlive (bool): True to keep connection alive. Defaults to False.
23042304
23052305
Returns:

0 commit comments

Comments
 (0)