Skip to content

Commit f406bc3

Browse files
committed
black formatting
1 parent ec474d1 commit f406bc3

3 files changed

Lines changed: 26 additions & 22 deletions

File tree

e3dc/_e3dc.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,9 +1247,9 @@ def get_battery_data(
12471247
(RscpTag.BAT_REQ_DCB_INFO, RscpType.Uint16, dcb),
12481248
],
12491249
),
1250-
keepAlive=True
1251-
if dcb != dcbs[-1]
1252-
else keepAlive, # last request should honor keepAlive
1250+
keepAlive=(
1251+
True if dcb != dcbs[-1] else keepAlive
1252+
), # last request should honor keepAlive
12531253
)
12541254

12551255
info = rscpFindTag(req, RscpTag.BAT_DCB_INFO)
@@ -1381,9 +1381,11 @@ def get_batteries_data(
13811381
self.get_battery_data(
13821382
batIndex=battery["index"],
13831383
dcbs=dcbs,
1384-
keepAlive=True
1385-
if battery["index"] != batteries[-1]["index"]
1386-
else keepAlive, # last request should honor keepAlive
1384+
keepAlive=(
1385+
True
1386+
if battery["index"] != batteries[-1]["index"]
1387+
else keepAlive
1388+
), # last request should honor keepAlive
13871389
)
13881390
)
13891391

@@ -1716,9 +1718,9 @@ def get_pvi_data(
17161718
),
17171719
],
17181720
),
1719-
keepAlive=True
1720-
if string != strings[-1]
1721-
else keepAlive, # last request should honor keepAlive
1721+
keepAlive=(
1722+
True if string != strings[-1] else keepAlive
1723+
), # last request should honor keepAlive
17221724
)
17231725
stringobj = {
17241726
"power": rscpFindTagIndex(
@@ -1771,9 +1773,9 @@ def get_pvis_data(
17711773
pviIndex=pvi["index"],
17721774
strings=strings,
17731775
phases=phases,
1774-
keepAlive=True
1775-
if pvi["index"] != pvis[-1]["index"]
1776-
else keepAlive, # last request should honor keepAlive
1776+
keepAlive=(
1777+
True if pvi["index"] != pvis[-1]["index"] else keepAlive
1778+
), # last request should honor keepAlive
17771779
)
17781780
)
17791781

@@ -1931,9 +1933,11 @@ def get_powermeters_data(
19311933
outObj.append(
19321934
self.get_powermeter_data(
19331935
pmIndex=powermeter["index"],
1934-
keepAlive=True
1935-
if powermeter["index"] != powermeters[-1]["index"]
1936-
else keepAlive, # last request should honor keepAlive
1936+
keepAlive=(
1937+
True
1938+
if powermeter["index"] != powermeters[-1]["index"]
1939+
else keepAlive
1940+
), # last request should honor keepAlive
19371941
)
19381942
)
19391943

e3dc/_e3dc_rscp_web.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,10 @@ def sendCommand(
354354
def _sendRequest_internal(
355355
self,
356356
innerFrame: bytes | Tuple[str | int | RscpTag, str | int | RscpType, Any],
357-
callback: Callable[
358-
[Tuple[str | int | RscpTag, str | int | RscpType, Any]], None
359-
]
360-
| None = None,
357+
callback: (
358+
Callable[[Tuple[str | int | RscpTag, str | int | RscpType, Any]], None]
359+
| None
360+
) = None,
361361
):
362362
"""Internal send request method.
363363

e3dc/_rscpLib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def rscpFindTag(
8585
if decodedMsg[0] == tagStr:
8686
return decodedMsg
8787
if isinstance(decodedMsg[2], list):
88-
msgList: List[
89-
Tuple[str | int | RscpTag, str | int | RscpType, Any]
90-
] = decodedMsg[2]
88+
msgList: List[Tuple[str | int | RscpTag, str | int | RscpType, Any]] = (
89+
decodedMsg[2]
90+
)
9191
for msg in msgList:
9292
msgValue = rscpFindTag(msg, tag)
9393
if msgValue is not None:

0 commit comments

Comments
 (0)