fix/feat:Add support for One Off Charging Timeres as well as start_climatisation fix - #653
Open
max-2468 wants to merge 7 commits into
Open
fix/feat:Add support for One Off Charging Timeres as well as start_climatisation fix#653max-2468 wants to merge 7 commits into
max-2468 wants to merge 7 commits into
Conversation
feat: support start_climatisation switch for charging timers
… multiple locations, recurring/one_off, start_climatisation on/off
…sserting only after a complete roundtrip
dvx76
requested changes
Aug 16, 2026
| ) | ||
| from mashumaro.mixins.orjson import DataClassORJSONMixin | ||
| from mashumaro.types import SerializationStrategy | ||
| from tribool import Tribool |
Member
There was a problem hiding this comment.
Can you try to implement this without the tribool package.
This adds another package dependency for something relatively trivial. More importantly that package hasn't been updated since 2016 and includes some questionable behavior (e.g. bool(Tribool(True)) raises a TypeError)
The start_climatisation field can just be typed as bool | None.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While doing some tests regarding PR #640 I did stumble across the toggle for start the climatisation of the car as well. Switching that on made a new field appear in the data send by the server.
Apparently the app/server/car will only notice this field once it has been manually set once, and will default a missing value to False. To handle this new field while ensuring compatiblity to the behaviour shown by the app (and not having to manually edit a lot of fixtures as well as ensuring compatibility for new fixtures) a special type was used to handle the distinction True, False, Unknown/None.
The handling of One_off charging timers is based on PR #640 by ethanhawke-gif.
This PR includes: