-
-
Notifications
You must be signed in to change notification settings - Fork 13
Hue crate changes needed for implementing wake-up automation #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Since this type is both highly dynamic and unknown we'll instead deserialize it after retrieving it from the state
self.configuration = value; | ||
} | ||
Err(err) => { | ||
// todo: what do we do here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to handle this error properly. I don't think it's possible to return errors from AddAssign
and the log
crate is not available (which makes sense since this is just a library).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, good point.
I think the answer is to make BehaviorInstanceUpdate.configuration
an Option<Value>
, so the assignment becomes trivial.
So instead of decoding when we receive the update, we decode when we want to look at the data.
If we need to attempt a decode, we can easily do this in the route handler, without preventing the AddAssign
from working 👍
Makes sense, or did I misunderstand?
const RESOLUTION_05S: u32 = 5; // 05s. | ||
const RESOLUTION_15S: u32 = 15; // 15s. | ||
const RESOLUTION_01M: u32 = 60; // 01min. | ||
const RESOLUTION_05M: u32 = 5 * 600; // 05min. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says 05min
, but looks more like 50 minutes - typo or edge case?
@@ -0,0 +1,78 @@ | |||
use crate::{error::HueResult}; | |||
|
|||
#[derive(PartialEq, Eq, Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please derive Clone
and Copy
(Clone
for all hue api structs, and Copy
for the ones that are "free")
Thanks for coming back for round 3! :) This is looking great! Absolutely minor stuff, easily fixed. Then we can get this half merged, and that will make everything easier 👍 |
This is a rebased version of #113 with only the
hue
crate changes. Hopefully this makes it easier to merge 😄