Giter Club home page Giter Club logo

Comments (9)

Hyrules avatar Hyrules commented on July 19, 2024

I know that is currently a problem but last time I tested this it didn't work as expected because the bridge does not reflect the changes right away. It takes about 5 to 10 secondes for the properties of a light to refresh after applying a scene. A while ago I had implemented some sort of heartbeat that would poll the bridge every 3 seconds and refresh the states but at one point I changed to the mvvm model and did not re-implement it again. It's the only way I can implement this.

from winhue.

fiveseven808 avatar fiveseven808 commented on July 19, 2024

Instead of polling, if you know the properties of the scene and what lights are reachable at the time, wouldn't you be able to just set the values blindly without pulling a refresh?

Possibly pull a refresh 5-10 seconds later just to re-confirm the blindly assigned values ?

from winhue.

Hyrules avatar Hyrules commented on July 19, 2024

that's the problem. I don't know the properties of the scenes. The scenes objects only gives me the lights which are affected by the scenes. I have to fetch the settings of the scenes from then lights if it's a new scene v2. The only other option is to wait see if the scenes was applied successfully and the change the property of the object in memory with the changed value.

from winhue.

fiveseven808 avatar fiveseven808 commented on July 19, 2024

When I click on "edit" a scene, it looks like the properties of the scene are pulled, no? When a scene is activated, maybe the scene info can be pulled and then applied to the light statuses when activated? Or the properties of the scenes can be pulled when the program is opened from the beginning?

from winhue.

Hyrules avatar Hyrules commented on July 19, 2024

I'll see what I can do about this.

from winhue.

Hyrules avatar Hyrules commented on July 19, 2024

By the way if you test this you will find that only V2 of the scenes refresh lights right away. (in the bridge that is) Version 1 don't because the informations of lights are not on the bridge so it takes a few seconds for the bridge to poll the light and get it state. That's not the case with V2.

from winhue.

fiveseven808 avatar fiveseven808 commented on July 19, 2024

Everything seems to be working! Thanks!

What's the difference between V2 and V1 scenes? I've noticed I only have V2 scenes in my bridge.

from winhue.

Hyrules avatar Hyrules commented on July 19, 2024

V2 of the scenes settings are stored on the bridge directly. Version 1 had the bridge send the lights their settings for the scene. The bridge didn't know what the color of the light until it was polled so it took a couple of seconds for the bridge to get the new state of the light since it poll them at regular interval. With version 2 that's not the case. The light settings are immediately changed upon activation of a scene.

from winhue.

fiveseven808 avatar fiveseven808 commented on July 19, 2024

Good to know! Thanks!

from winhue.

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.