Merged
Conversation
Contributor
Author
|
PS: Depending on what the original intent was for using that url quoting, a more elegant approach could be to specify the required characters as "safe characters" (instead of introducing a new parameter). The following works fine for me too: https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote |
Owner
|
@rhegner I would prefer your second option, to not add additional parameters here :) |
added 2 commits
May 12, 2025 07:16
This reverts commit 74a9cec.
Contributor
Author
|
Yes, it's cleaner. I updated my PR. |
Contributor
Author
|
@iMicknl do you plan to release a new version of your library with this PR included anytime soon? |
Owner
Done! |
bakonyiferenc
pushed a commit
to bakonyiferenc/python-sagemcom-api
that referenced
this pull request
Dec 16, 2025
I had a second problem with my "Sunrise Internet Box".
Attempting to read the value of the following xpath failed:
```
Device/IP/Interfaces/Interface[Alias='IP_DATA']/IPv4Addresses/IPv4Address[Alias='IP_DATA_ADDRESS']/IPAddress
```
Instead of the IP address I was looking for, `get_value_by_xpath`
returned a JSON structure with lots of status information in it, but not
the IP address I was looking for. Turns out that url quoting messed
things up.
So I added a new parameter to the `get_value_by_xpath` function:
The following now returns the desired IP address as expected:
```
await client.get_value_by_xpath("Device/IP/Interfaces/Interface[Alias='IP_DATA']/IPv4Addresses/IPv4Address[Alias='IP_DATA_ADDRESS']/IPAddress", { "capability-flags": { "interface": True }}, False)
```
---------
Co-authored-by: Robert Hegner <robert.hegner@loftdynamics.com>
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.
I had a second problem with my "Sunrise Internet Box".
Attempting to read the value of the following xpath failed:
Instead of the IP address I was looking for,
get_value_by_xpathreturned a JSON structure with lots of status information in it, but not the IP address I was looking for. Turns out that url quoting messed things up.So I added a new parameter to the
get_value_by_xpathfunction:The following now returns the desired IP address as expected: