Comments (4)
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.
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.
Fixed by pull request #174 which implements whitelisting of "Extended color light".
from foxbox.
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)
- Intermittent SSL linking failures on Mac OS X HOT 2
- Travis: Some components might not `cargo test` because dependencies are too recent HOT 4
- OpenZWave: Merge getter and setter maps
- Our env_logger configuration doesn't dispaly the location HOT 1
- HTTP API should leverage HTTP Cache (via Etag or Last-Modified-Since headers) HOT 4
- Add the ability to describe channels and services
- Taxonomy should offer a DELETE operation
- When channel setter is called with wrong arguments all possible setters are called HOT 10
- HTTP API should use HTTP Compression
- Use l10n on the UI
- `build.rs` doesn't spot wrong rustc version HOT 3
- Rename OpenClosed => IsOpen, OnOff => IsOn
- Thinkerbell rules should be delivered as JSON, not strings HOT 1
- Add a feature to turn on/off zwave support at build time. HOT 1
- API error response should be clearly distinguishable from the successful one
- Can't generate Let'sEncrypt certificates with outdated letsencrypt.sh script version (Ubuntu 16.04 LTS 64-bit) HOT 1
- Update readme
- Let users choose a friendly remote name.
- Fails to build on OSX HOT 1
- Fails to build on Debian 3.16.36-1+deb8u1 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foxbox.