Open mrichtarsky opened 5 days ago
In addition to adjusting the docs, which I will do, I wonder about error handling in general. It is misleading to output a power value of 0, which could be a real value, instead an error should be raised. How can an error be raised in this case for this template? I checked some others but could not see a mechanism.
The API HTTP response is 200, perhaps an error would be raised if it wasn't?
Otherwise, a check should be done for success
and an error raised if it is not true
.
It is misleading to output a power value of 0, which could be a real value, instead an error should be raised. How can an error be raised in this case for this template? I checked some others but could not see a mechanism.
That's a good point. One approach could be for the templates to extract data using JQ and- if data not available return something else ("error" string) that will trigger an upstream parsing error that is then returned.
Token without quotes is interpreted as a number and encoded as float
uri: https://www.solaxcloud.com/proxyApp/proxy/api/getRealtimeInfo.do?tokenId={{ urlEncode .tokenid }}&sn={{ urlEncode .serial }}
Wondering where that does wrong. Anyway, using quotes to make this disambiguous in yaml is generally best practice and should not be required to be documented per template.
That's a good point. One approach could be for the templates to extract data using JQ and- if data not available return something else ("error" string) that will trigger an upstream parsing error that is then returned.
Would it be feasible to come up with a common way of doing that for all templates to use? (and document it) I could fix it in the Solax template then.
uri: https://www.solaxcloud.com/proxyApp/proxy/api/getRealtimeInfo.do?tokenId={{ urlEncode .tokenid }}&sn={{ urlEncode .serial }}
Wondering where that does wrong. Anyway, using quotes to make this disambiguous in yaml is generally best practice and should not be required to be documented per template.
It's easy to forget though here. Usually it's not an issue since tokens often also contain characters.
I have pushed #17281, also updating the instructions which seem to have changed.
Describe the bug
pv value is always 0
Reason:
ToDo:
Steps to reproduce
Configuration details
Log details
What type of operating system are you running?
Linux
Nightly build
Version
No response