Skip to content
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

AdcParam does not accept negative values #22809

Closed
13 tasks
avp-avp opened this issue Jan 12, 2025 · 0 comments
Closed
13 tasks

AdcParam does not accept negative values #22809

avp-avp opened this issue Jan 12, 2025 · 0 comments
Assignees
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended

Comments

@avp-avp
Copy link

avp-avp commented Jan 12, 2025

PROBLEM DESCRIPTION

For some sensors you should use negative values param3 in AdcParam. But parser AdcParam use abs() for param3 and param4.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  Configuration output here:
18:48:34.308 MQT: stat/tasmota_E1B5EC/RESULT = {"NAME":"Lytko 101","GPIO":[1,7584,1312,1,1792,1824,0,0,1,1,1,224,3840,4736],"FLAG":0,"BASE":18}
18:48:34.511 MQT: stat/tasmota_E1B5EC/RESULT = {"Module":{"0":"Lytko 101"}}
18:48:34.723 MQT: stat/tasmota_E1B5EC/RESULT = {"GPIO0":{"0":"None"},"GPIO1":{"7584":"Heartbeat"},"GPIO2":{"1312":"DS18x201"},"GPIO3":{"0":"None"},"GPIO4":{"1792":"SerBr Tx"},"GPIO5":{"1824":"SerBr Rx"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"224":"Relay1"},"GPIO16":{"3840":"Output Hi"},"GPIO17":{"4736":"ADC Temp"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:

  • Provide the output of this command: Status 0:
  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:

TO REPRODUCE

Steps to reproduce the behavior:
AdcParam1 2,14800,2200,-3911,0

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.
I expect negative value for param3
18:51:21.301 CMD: AdcParam1 2,14800,2200,-3911,0
18:51:21.312 MQT: stat/tasmota_E1B5EC/RESULT = {"AdcParam1":[17,14800,2200,3911,0]}

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.
I removed abs() from
Adc[channel].param[2] = abs(strtol(ArgV(argument, 4), nullptr, 10)); // param3 = abs(int)
and problem was solved

(Please, remember to close the issue when the problem has been addressed)

@arendst arendst self-assigned this Jan 14, 2025
@arendst arendst added enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended labels Jan 14, 2025
@arendst arendst closed this as completed Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests

2 participants