fix(cmd): Handle missing device_type argument#138
Open
loveyou001 wants to merge 1 commit intoMickMake:masterfrom
Open
fix(cmd): Handle missing device_type argument#138loveyou001 wants to merge 1 commit intoMickMake:masterfrom
loveyou001 wants to merge 1 commit intoMickMake:masterfrom
Conversation
When the optional device_type argument is omitted from the 'show ps data' and 'show ps graph' commands, the arguments are misinterpreted, leading to incorrect API calls. This commit fixes the issue by explicitly checking for the presence of the device_type argument and returning an error if it is missing when a date range is provided. This ensures that the command fails gracefully with a clear error message instead of making an invalid API call.
|
I have included this PR in the list of patches in Part 1 of the "Updating GoSungrow" gist. I have added Part 5 to the gist to explain how to take the recompiled binary and use it to construct an updated Docker image for use as the Home Assistant GoSungrow add-on. I hope this helps anyone who is can't run GoSungrow at the moment because of the problem which is fixed by this PR. |
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.
When the optional device_type argument is omitted from the 'show ps data' and 'show ps graph' commands, the arguments are misinterpreted, leading to incorrect API calls.
This commit fixes the issue by explicitly checking for the presence of the device_type argument and returning an error if it is missing when a date range is provided. This ensures that the command fails gracefully with a clear error message instead of making an invalid API call.