Git Product home page Git Product logo

Comments (2)

ZeroOne3010 avatar ZeroOne3010 commented on July 24, 2024

Hey, thanks for submitting an issue! Unfortunately that's not how scenes work. You recall one, it adjusts the affected lights -- and afterwards there's no way to know how the lights got to their current state. Even if it worked like you thought, relying on scenes still wouldn't be a good idea: what would the API even say as the scene of a room or a light, when a scene has been recalled, but some lights then adjusted manually?

I do sympathize with your confusion, the library kind of does lead you to believe it would work like that. 😞 Actually the getter method is there so you can read the settings you put into a scene yourself, when you are about to activate a scene. So the State object is kind of different depending on whether you created it or whether you got it from a Light or a Room, as the API does not populate all those values that you yourself can use.

All this being said, the solution to your problem should be to simply get the states of the lights in the room, not the scenes. 😃 Remember to enable caching (Hue#setCaching(true)) before you get the states of all the lights. That way it does not call the API ten times if there are ten lights in the room. Then, once you've stored the states, disable caching again. There's more on the subject of caching in README.md.

I will add Javadoc comments for the State#getScene() method clarifying the issue! Thank you and sorry again. 😅

from yetanotherhueapi.

jonteohr avatar jonteohr commented on July 24, 2024

Thank you very much for that explanation! Will continue to test and see how I'll solve this :)

from yetanotherhueapi.

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.