GithubHelp home page GithubHelp logo

Comments (4)

Jey-Cee avatar Jey-Cee commented on June 17, 2024

#f57c746

from iobroker.deconz.

asgothian avatar asgothian commented on June 17, 2024

I tested this, but still got the same error.

2019-01-08 20:52:07.077 - warn: deconz.0 Set light state with ID: 1 parameter: {"xy": ["0.634999,0.264986"]} Code 400: Bad request

I then went ahead and changed the lines in main.js locally from
parameters = '{"xy": [' + JSON.stringify(state.val) + ']}';
to
parameters = '{"xy": [' + state.val + ']}';
and
parameters = '{"transitiontime": ' + JSON.stringify(ttime) + ', "xy": [' + JSON.stringify(state.val) + ']}';
to
parameters = '{"transitiontime": ' + JSON.stringify(ttime) + ', "xy": [' + state.val + ']}';

This change makes it work with well formed values. I also tried entering all kinds of odd strings. The behavior was consistent and beneficial. Any entry which was not x,y with x and y being numbers between 0.0 and 1.0 resulted in an error like the two examples below

2019-01-08` 21:47:08.620 - warn: deconz.0 Set light state with ID: 1 parameter: {"xy": [\'hall\'o]} Code 400: Bad request
2019-01-08 21:45:02.658 - warn: deconz.0 {"address":"/lights/1","description":"invalid value, [100,100], for parameter, /lights/1/xy","type":7}

In all the other cases, the color of the lamp changed and the values were accepted. In case of the lamp not being able to reach the exact coordinate, the xy coordinates would later update / to what i assume to be the closest reachable coordinate.

from iobroker.deconz.

Jey-Cee avatar Jey-Cee commented on June 17, 2024

Thanks i changed it.

from iobroker.deconz.

asgothian avatar asgothian commented on June 17, 2024

Thanks for fixing it so quickly. I hope it works for the other two as well.

from iobroker.deconz.

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.