-
Notifications
You must be signed in to change notification settings - Fork 59
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
JSON API SysVar.setEnum is not working as expected #117
Comments
Please show the actual payload you are sending and the concrete example response which you feel is invalid JSON. And please state if you have tested this also already with RaspberryMatic. |
Sure, payload for
Response is successful:
Payload for
Response is successful but invalid syntax (#113 is discussing this issue and has a fix, i just mentioned it):
Next Payload for
Response is successful but looks wrong to me:
It's not tested with RasperryMatic, i will try it tomorrow. Am i using the whole ENUM type wrong? My expectation was to define a list (valueList) of allowed values and to select one of these as current value. The documentation for Here some example for a boolean variable:
The My new conclusion is: |
Yes, you are IMHO expecting |
"0" is a perfectly fine result here. You misunderstanding is, that you expect the actual value to be returned by |
JSON related quoting fixes and also modify the SysVar.* json methods to make sure that all these apply to system variable objects only and not generally to all objects throughout rega (programs, devices, etc.). This refs eq-3/occu#117 and eq-3/occu#118
I got caught by the comment in the method, "Setzt den Wert einer Systemvariable", i was wondering why it asks for |
To reproduce create a "List" system variable, e.g. named "Test" with values "Foo;Bar;Other" (But use the WebUI, i am still looking for a way to delete a variable with the JSON API).
Now callSysVar.setEnum
with{name: "Test", valueList: "Bar"}
. The result will return some invalid JSON (#113), but will "Bar" is successfully selected.Now we would call
SysVar.setEnum
with{name: "Test", value: "Bar"}
or{name: "Test", value: 1}
to set a new value index, but the method only exceptsvalueList
, there is no way to change the selected index?Now useThe value will always beSysVar.getAll
,SysVar.getValue
orSysVar.getValueByName
and there will always be the same:result: "0"
orvalue: "0"
."0"
, the first element of the list, because i am not able to change it.Hardware: CCU3
Software: 3.65.6
The text was updated successfully, but these errors were encountered: