Skip to content

Commit

Permalink
Use timedelta to increment the date for scheduled battery heating
Browse files Browse the repository at this point in the history
  • Loading branch information
nanomad committed Jan 31, 2024
1 parent 7618a1d commit 7d2504f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/saic_ismart_client_ng/api/vehicle_charging/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timedelta

from saic_ismart_client_ng.api.base import AbstractSaicApi
from saic_ismart_client_ng.api.vehicle_charging.schema import ChargeInfoResp, ChargeStatusResp, ChargingControlRequest, \
Expand Down Expand Up @@ -137,7 +137,7 @@ async def enable_schedule_battery_heating(
microsecond=0
)
if start_date < datetime.now():
start_date = start_date.replace(day=start_date.day + 1)
start_date = start_date + timedelta(days=1)
body = ScheduledBatteryHeatingRequest(
vin=sha256_hex_digest(vin),
startTime=int(start_date.timestamp()) * 1000,
Expand Down

0 comments on commit 7d2504f

Please sign in to comment.