Code Monkey home page Code Monkey logo

Comments (4)

jens-maus avatar jens-maus commented on August 18, 2024

Please show an example payload with example response output and not just explain your issues with words. Show concrete examples!

from occu.

pmdevelopment avatar pmdevelopment commented on August 18, 2024

Sure, payload for SysVar.createEnum:

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

Response is successful:

{"version": "1.1","result": {'name':'Test','id':'6968','value':'Foo;Bar;Other' },"error": null}

Payload for SysVar.deleteSysVarByName:

{"name":"Test"}

Response is successful:

{"version": "1.1","result": true,"error": null}

SysVar.getAll won't list the variable anymore, but e.g. SysVar.getValueByName will return:

{"version": "1.1","result": "0","error": null}

Asking for a non-existing variable would look like this:

{"name":"Foobar"} => {"version": "1.1","result": "","error": null}

Now the payload to create the variable again:

{"name":"Test","valList":"A;B;C","internal":"0","chnID":"-1"}

The response shows our variable was created with a new name to prevent the conflict with our soft-deleted one:

{"version": "1.1","result": {'name':'Test 2','id':'6971','value':'A;B;C' },"error": null}

from occu.

jens-maus avatar jens-maus commented on August 18, 2024

I am almost certain that the issue just happens because you have another object (device, channel, program, etc.) that has also the name "Test". Unfortunately, the SysVar.getValueByName function does not filter for system variables but applies the search to all objects, that's why your request for a "Test" system variable still matches, simply because the getValueByName function is doing the search wrong. This is something I will try to fix/optimized in RaspberryMatic.

from occu.

pmdevelopment avatar pmdevelopment commented on August 18, 2024

It's definitly not because of "Test", my original Parameter was "APP_VENTILATION_STATUS". If you create, delete and recreate the same Systemvariable in the WebUI, the name won't add a number, it's only this behaviour with the JSON API.

I think the SysVar methods for the JSON API are just not used very often, i guess most software will program the channels directly instead of using a system variable change to trigger programs.

from occu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.