Skip to content

fix: support one-off charging profile timers - #640

Open
ethanhawkes-gif wants to merge 1 commit into
skodaconnect:mainfrom
ethanhawkes-gif:agent/fix-one-off-charging-timers
Open

fix: support one-off charging profile timers#640
ethanhawkes-gif wants to merge 1 commit into
skodaconnect:mainfrom
ethanhawkes-gif:agent/fix-one-off-charging-timers

Conversation

@ethanhawkes-gif

Copy link
Copy Markdown

Fixes #631.

ONE_OFF charging timers contain oneOffDay and omit recurringOn, but ChargingTimers.recurring_on was required. That made the reporter's charging-profile response fail during deserialization.

This change adds the oneOffDay mapping, makes the two day selectors optional, omits the unused selector on serialization, and preserves the API's HH:MM time format for both recurring and one-off timers.

Validation:

  • 2 focused charging-profile tests passed
  • 535 tests passed
  • Ruff and Ruff format passed on the changed files
  • Pyright passed
  • uv lock --check passed

One theoretical edge remains: a malformed timer with neither day selector can deserialize, but its by-alias time serialization falls back to HH:MM:SS. I did not find this shape in the issue payload or open work; happy to enforce that invariant here if preferred.

@ethanhawkes-gif
ethanhawkes-gif marked this pull request as ready for review August 2, 2026 16:49
@WebSpider

Copy link
Copy Markdown
Contributor

Thanks for your PR!

The code itself looks good, but can you add the errored API-reply from #631 as a fixture?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mashumaro.exceptions.MissingField: Field "recurring_on" of type list[Weekday] is missing in ChargingTimers instance

2 participants