added second websocket to get the Challenge ws.#223
Closed
Leicas wants to merge 3 commits intodvd-dev:mainfrom
Closed
added second websocket to get the Challenge ws.#223Leicas wants to merge 3 commits intodvd-dev:mainfrom
Leicas wants to merge 3 commits intodvd-dev:mainfrom
Conversation
There was a problem hiding this comment.
Code Review for this PR
The changes introduce new functionality for handling a new websocket (websocket2) as well as an endpoint related to Automation Challenges. These additions are integrated into the existing methods and create new helper methods for negotiating and managing websocket connections.
Positives:
- Addition of automated negotiation and connection parameter retrieval for 'websocket2' which extends the capability of the API client.
- Comprehensive debug logging has been consistently applied throughout the modifications, which assists in tracing the flow and pinpointing issues.
Areas of Improvement:
- Inline comments explaining non-obvious decisions should be enhanced for better context understanding.
- The redundancy in websocket2 initialization within the '_async_post_init' method needs to be evaluated for optimization and to prevent future maintenance challenges.
Comment on lines
+232
to
+234
| if endpoint.startswith(AUTOMATION_CHALLENGE_ENDPOINT): | ||
| # remove Ocp-Apim-Subscription-Key header to avoid 401 error | ||
| kwargs["headers"].pop("Ocp-Apim-Subscription-Key", None) |
There was a problem hiding this comment.
The logic for removing the 'Ocp-Apim-Subscription-Key' header should be documented with a rationale or alternatively, a reference to a relevant section of the API documentation if available. This will help future developers understand the necessity of this operation in the context of API interactions.
Suggested change
| if endpoint.startswith(AUTOMATION_CHALLENGE_ENDPOINT): | |
| # remove Ocp-Apim-Subscription-Key header to avoid 401 error | |
| kwargs["headers"].pop("Ocp-Apim-Subscription-Key", None) | |
| # remove Ocp-Apim-Subscription-Key header based on API requirements to avoid 401 error |
Collaborator
|
Fermeture car refait en class voir #224 |
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.
No description provided.