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

JSON API SysVar.createEnum will always be internal #119

Open
pmdevelopment opened this issue Jul 12, 2022 · 3 comments
Open

JSON API SysVar.createEnum will always be internal #119

pmdevelopment opened this issue Jul 12, 2022 · 3 comments

Comments

@pmdevelopment
Copy link

pmdevelopment commented Jul 12, 2022

To reproduce create a system variable using SysVar.createEnum, expected parameters are "name", "valList", "internal" and "chnID".

For internal, the tcl (createenum.tcl) documents that an integer value is to be passed. I tried 0, 1, 2 and false (you never now), in all cases the api would not return any sort of error, but never would create a visible variable.

As requested for the other issues some payloads. SysVar.createEnum:

"{"name":"Public","valList":"Foo;Bar;Other","internal":"0","chnID":"-1"}

Response is successful:

{"version": "1.1","result": {'name':'Public','id':'6972','value':'A;B;C' },"error": null}

SysVar.getAll will show the variable as internal, the WebUI will not show it:

{
 "id":"6972",
 "name":"Public",
 "type":"LIST",
 "unit":"",
 "value":"0",
 "channelId":"65535",
 "valueList":"A;B;C",
 "isLogged":false,
 "isVisible":true,
  "isInternal":true
}
@jens-maus
Copy link

jens-maus commented Jul 12, 2022

Sorry, but for me this works with the following JSON payload:

{"version": "1.1", "method": "SysVar.createEnum", "params": {"name": "TestPublic", "valList": "Foo;Bar;Blue", "internal": 1, "chnID": -1, "_session_id_": "XXXXX"}}

The response will then be:

{"version": "1.1","result": {"name":"TestPublic","id":"2634","value":"Foo;Bar;Blue" },"error": null}

@pmdevelopment
Copy link
Author

Yes, but are you able to use SysVar.createEnum to create a system variable that IS visible to the WebUI and NOT internal? The variable is created, my problem is no matter what value the payload for "internal" uses, the variable will be internal and not visible to the WebUI.

jens-maus added a commit to jens-maus/RaspberryMatic that referenced this issue Jul 12, 2022
sysvar creating with Internal() working correctly. This refs eq-3/occu#119
@jens-maus
Copy link

Ok, I tested SysVar.createEnum again and I could replicate the issue indeed. Thus, I have added another fix for this method so that setting the internal status should be possible now with the next RaspberryMatic version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants