@@ -166,24 +166,24 @@ def test_calc_remaining_time(phases_to_use,
166166
167167
168168@pytest .mark .parametrize (
169- "selected, phases, bidi , expected_duration, expected_missing_amount" ,
169+ "selected, phases, bidi_charging_enabled , expected_duration, expected_missing_amount" ,
170170 [
171171 pytest .param ("soc" , 1 , False , 10062.111801242236 , 9000 , id = "soc, one phase" ),
172172 pytest .param ("amount" , 2 , False , 447.2049689440994 , 800 , id = "amount, two phases" ),
173173 pytest .param ("soc" , 2 , True , 3240.0 , 9000 , id = "bidi" ),
174174 ])
175175def test_calculate_duration (selected : str ,
176176 phases : int ,
177- bidi : bool ,
177+ bidi_charging_enabled : bool ,
178178 expected_duration : float ,
179179 expected_missing_amount : float ):
180180 # setup
181181 ct = ChargeTemplate ()
182- plan = ScheduledChargingPlan (bidi = bidi )
182+ plan = ScheduledChargingPlan (bidi_charging_enabled = bidi_charging_enabled )
183183 plan .limit .selected = selected
184184 # execution
185185 duration , missing_amount = ct ._calculate_duration (
186- plan , 60 , 45000 , 200 , phases , ChargingType .AC .value , EvTemplate (), bidi )
186+ plan , 60 , 45000 , 200 , phases , ChargingType .AC .value , EvTemplate (), bidi_charging_enabled )
187187
188188 # evaluation
189189 assert duration == expected_duration
@@ -226,7 +226,7 @@ def test_scheduled_charging_recent_plan(end_time_mock,
226226
227227
228228@pytest .mark .parametrize (
229- "plan_data, soc, used_amount, selected, bidi , expected" ,
229+ "plan_data, soc, used_amount, selected, bidi_charging_enabled , expected" ,
230230 [
231231 pytest .param (None , 0 , 0 , "none" , False , (0 , "stop" ,
232232 ChargeTemplate .SCHEDULED_CHARGING_NO_DATE_PENDING , 3 ), id = "no date pending" ),
@@ -262,13 +262,13 @@ def test_scheduled_charging_calc_current(plan_data: SelectedPlan,
262262 soc : int ,
263263 used_amount : float ,
264264 selected : str ,
265- bidi : bool ,
265+ bidi_charging_enabled : bool ,
266266 expected : Tuple [float , str , str , int ]):
267267 # setup
268268 ct = ChargeTemplate ()
269269 plan = ScheduledChargingPlan (active = True , id = 0 )
270270 plan .limit .selected = selected
271- plan .bidi = bidi
271+ plan .bidi_charging_enabled = bidi_charging_enabled
272272 # json verwandelt Keys in strings
273273 ct .data .chargemode .scheduled_charging .plans = [plan ]
274274 if plan_data :
0 commit comments