-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix #628: hex values for repl arguments #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4f094ff to
89fc136
Compare
|
I think you forgotten to update your dev, with Pymodbus dev, before starting this PR. I see at least parts of your previous commit in this commit. Please update your dev with the latest from Pymodbus and rebase this PR. Btw it is a good idea to develop in a branch not named dev, because it makes it easier to do: When you develop on dev, you easily run into conflicts with Pymodbus dev (e.g. I updated your commit before merging it). |
|
Made fix_628 branch..shall I close this PR and start a new one? |
|
It is not a demand from my side, but it might be easier for you. |
|
The CI error is something that is fixed on dev. |
Also fixed some issues with repl client for unit handling
|
Please look at your commit it still contains e.g. the super() change. |
| if "," in val: | ||
| val = val.split(",") | ||
| val = [int(v) for v in val] | ||
| val = [int(v, 0) for v in val] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this helping?
From the docs Base 0 means to interpret exactly as a code literal, so that the actual base is 2, 8, 10, or 16, and so that int('010', 0) is not legal, while int('010') is, as well as int('010', 8).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share some outputs with out this change and with this change please?
pymodbus.console >> client.read_holding_registers unit=0x1 count=0x20 address=0x30 is this something you are trying to achieve here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a short review of your code, and I agree with @dhoomakethu it do look strange. Your idea is OK, but you need to work on the implementation (and solve your rebase problem).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int([str], 0) takes any sensible value as numerical. The original request was for accepting hex values. int([str], 0) accepts any value, with the cost that int('010', 0) throws ValueException - that can be handled by catching it and trying int([str]), perhaps in a function, as this is on multiple places in the code.
I am not sure about rebasing issues. I discovered problems in my previous PR (#1041), which I fixed with this. Do you want to make an extra PR for improving those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I already told you, your problems come from the fact that you use dev to submit PRs. You need to submit a PR based on the latest dev, whether you do it in this PR or open a new PR is up to you. I gave you a recipe how to work with dev and branches for each PR.
You need to prove that your PR accept hex values without causing problems. I believe that '010' is accepted today (without having tested it), so it needs to be accepted in this PR as well.
The best way to show your changes works as expected, is to write some test cases in test/test_.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
janiversen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to address the concerns from @dhoomakethu and solve the rebase problem.
|
Did you get your dev fixed ? We are still looking forward to see new PRs from you. |
|
Please see #1075 for new PR. |
Also fixed some issues with repl client for unit handling