leapconnect icon indicating copy to clipboard operation
leapconnect copied to clipboard

Setting a charge limit also resets scheduled charging time to 00:00

Open danye72 opened this issue 5 months ago • 1 comments

I noticed that when I set any charge limit, the scheduled charging time is also incorrectly changed to 00:00.

Expected behavior

Changing the charge limit should only update the charge limit.

The scheduled charging time should remain unchanged unless explicitly modified by the user.

danye72 avatar Jun 12 '26 17:06 danye72

Fixed in leapmotor-api — will ship in the next leapconnect release v0.11.0.

The root cause was in the leapmotor-api library. When set_charge_limit() performed a read-modify-write of the charge schedule, it guarded the merge logic on the presence of cycles, but for an enabled start-time-only plan, the cloud omits cycles, endtime, and recharge from the response. This caused the code to fall into the all-defaults branch, resetting starttime to 00:00 and disabling the schedule entirely.

The fix now preserves every field the getAppointment response actually includes (notably starttime and chargeEnable) and falls back to per-field defaults only for the genuinely missing fields, so only chargesoc (the charge limit) is changed. It has been committed to leapmotor-api and will be included in the next release of leapconnect.

markoceri avatar Jun 17 '26 21:06 markoceri