aehmlo / lifxi Goto Github PK
View Code? Open in Web Editor NEWA Rust wrapper for LIFX bulbs.
A Rust wrapper for LIFX bulbs.
With the traits approach, we have a bunch of #[doc(hidden)] pub struct Foo
going on, and we have a lot of duplication of methods that shouldn't really be necessary. If we can consolidate this into a large enum, we'll be able to get rid of a lot of this; however, this would mean that the library is no longer easily extensible. I'll have to put some thought into what to do here, but it's a "later" type of issue either way.
Selectors can be concatenated with commas in between to make combined selectors (up to 25 selectors in length) in order to address multiple disparate devices at once. This isn't necessary for us to implement just yet, but I don't want to forget about it.
Introduce a method (retry
? send_retry
? send().retry()
?) that automatically retries failed requests, waiting an appropriate duration if needed for rate-limiting.
We currently have more boilerplate for each client/request pathway than we really need. Let's try to distill the information we need (path, method) into a couple of trait methods and move to using a more uniform type for the T
in Request<'a, T>
. We could even move to a trait method returning &impl Serialize
or something, if that makes sense with the new structure.
Some endpoints support a "fast mode," so we should enable this in the client.
I would like to handle the responses from the API a little further than the current "hand off the raw data to the consumer" approach manages. For instance, I'd like to be able to tell the user they're using an invalid token, or that their color is invalid. I'll probably do this by looking at the possible responses to each request as documented in the API docs and covering just those at first.
Instead of continuing to build HashMap
s and passing those to reqwest
, we should leverage serde
's awesome serialization capabilities. We should also deserialize API requests into nicely-typed objects, but that's another issue altogether.
We need to support creation and parsing of colors which contain multiple HSBK components (currently we support only one of these at a time). We shouldn't assume there's a guarantee on what order the components will be in, so we'll probably just split it up and match on each label (we'll probably want to use Option::swap
and validate that we're not doing this more than once for each label).
We have lots of duplicated code around request retrying (#9) that I would like to remove. I don't see a way to store the information without adding some fields/methods to each struct in the chain, but maybe we can add a custom derive
/procedural macro to make this less cumbersome.
We currently support the HTTP API, which is awesome, but let's also add support for the LAN version.
All examples currently use use lifx::http::*
, but there's stuff in there that people don't need (and possibly stuff that conflicts, like Duration
), so let's add a prelude instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.