@@ -318,9 +318,7 @@ def poll(self, keepAlive: bool = False):
318318 "production" : {"solar" : solar , "add" : - add , "grid" : grid },
319319 "selfConsumption" : sc ,
320320 "stateOfCharge" : soc ,
321- "time" : datetime .datetime .utcfromtimestamp (ts ).replace (
322- tzinfo = datetime .timezone .utc
323- ),
321+ "time" : datetime .datetime .fromtimestamp (ts , tz = datetime .timezone .utc ),
324322 }
325323
326324 self .lastRequest = outObj
@@ -1247,9 +1245,9 @@ def get_battery_data(
12471245 (RscpTag .BAT_REQ_DCB_INFO , RscpType .Uint16 , dcb ),
12481246 ],
12491247 ),
1250- keepAlive = True
1251- if dcb != dcbs [- 1 ]
1252- else keepAlive , # last request should honor keepAlive
1248+ keepAlive = (
1249+ True if dcb != dcbs [- 1 ] else keepAlive
1250+ ) , # last request should honor keepAlive
12531251 )
12541252
12551253 info = rscpFindTag (req , RscpTag .BAT_DCB_INFO )
@@ -1381,9 +1379,11 @@ def get_batteries_data(
13811379 self .get_battery_data (
13821380 batIndex = battery ["index" ],
13831381 dcbs = dcbs ,
1384- keepAlive = True
1385- if battery ["index" ] != batteries [- 1 ]["index" ]
1386- else keepAlive , # last request should honor keepAlive
1382+ keepAlive = (
1383+ True
1384+ if battery ["index" ] != batteries [- 1 ]["index" ]
1385+ else keepAlive
1386+ ), # last request should honor keepAlive
13871387 )
13881388 )
13891389
@@ -1716,9 +1716,9 @@ def get_pvi_data(
17161716 ),
17171717 ],
17181718 ),
1719- keepAlive = True
1720- if string != strings [- 1 ]
1721- else keepAlive , # last request should honor keepAlive
1719+ keepAlive = (
1720+ True if string != strings [- 1 ] else keepAlive
1721+ ) , # last request should honor keepAlive
17221722 )
17231723 stringobj = {
17241724 "power" : rscpFindTagIndex (
@@ -1771,9 +1771,9 @@ def get_pvis_data(
17711771 pviIndex = pvi ["index" ],
17721772 strings = strings ,
17731773 phases = phases ,
1774- keepAlive = True
1775- if pvi ["index" ] != pvis [- 1 ]["index" ]
1776- else keepAlive , # last request should honor keepAlive
1774+ keepAlive = (
1775+ True if pvi ["index" ] != pvis [- 1 ]["index" ] else keepAlive
1776+ ) , # last request should honor keepAlive
17771777 )
17781778 )
17791779
@@ -1931,9 +1931,11 @@ def get_powermeters_data(
19311931 outObj .append (
19321932 self .get_powermeter_data (
19331933 pmIndex = powermeter ["index" ],
1934- keepAlive = True
1935- if powermeter ["index" ] != powermeters [- 1 ]["index" ]
1936- else keepAlive , # last request should honor keepAlive
1934+ keepAlive = (
1935+ True
1936+ if powermeter ["index" ] != powermeters [- 1 ]["index" ]
1937+ else keepAlive
1938+ ), # last request should honor keepAlive
19371939 )
19381940 )
19391941
0 commit comments