fix(usage): reset dto if provided value is equal to default#421
Merged
jnioche merged 1 commit intoBoavizta:mainfrom Nov 7, 2025
Merged
fix(usage): reset dto if provided value is equal to default#421jnioche merged 1 commit intoBoavizta:mainfrom
jnioche merged 1 commit intoBoavizta:mainfrom
Conversation
* Add function to reset usage_location to None if value is equal to default * Add test
jonperron
commented
Oct 25, 2025
|
|
||
|
|
||
| def _reset_usage_dto_if_matches_config_defaults(usage_dto: Usage): | ||
| """Reset usage_dto fields to None if they match the config default values.""" |
Collaborator
Author
There was a problem hiding this comment.
To the reviewer: I created this new function so this might be extensible to more properties in the future. At the moment, I focused on the usage_location value which is the source of the issue, plus it seemed to me the only value which was not equal to "DEFAULT" in the config file.
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.
Changelog
I tested manually the results from the calls with/without location values (when equal to EEE) and the JSON are similar 👍
Fix #418