Giter Site home page Giter Site logo

Comments (4)

cr avatar cr commented on July 1, 2024

I was expecting something like this to happen at some point. Unfortunately it's hard to work around reliably, because we don't have adaptive JSON parsing in Rust at this point. You either have to know the data returned beforehand, breaking parsing on every unexpected field – be it by discovering new hardware or by firmware update –, or you have to employ dynamic parsing on every access. That would require turning all the easily-maintable structs into much harder to grasp and maintain parsers.

Not sure yet if there's a good middle ground. For now I'll add the fields as optional, but that process will have to continue for a while. Perhaps white-listing of supported types would be a viable mid-term solution.

from foxbox.

nojunpark avatar nojunpark commented on July 1, 2024

Just a thought, since the "modelid" field would be present in all types of lightbulb, can we get the modelid value first, and determine which field values to collect based on it? like, of it is LCT007, then we seek for the color values, and if it LWB006, then we seek for dimmer values, and so on. Probably need a separate JSON struct for each type of the bulb I suppose.

Another thing would be that foxbox should not send incorrect commands to the philips hub - for example, currently the on command also sends hue values as well, which the non-color bulbs won't process. (if they simply ignore them, then it should be okay, but the user would be confused if the UI app shows option to change colors for a white dimmer bulb) Maybe keeping track of which type of bulbs are configured could be a good way to avoid this?

but perhaps this bug is outside the scope of the upcoming demo I suppose?

from foxbox.

cr avatar cr commented on July 1, 2024

Fixed by pull request #174 which implements whitelisting of "Extended color light".

from foxbox.

cr avatar cr commented on July 1, 2024

The long term solution with support for multiple light types will be implemented for the rewrite on top of the new taxonomy.

from foxbox.

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.