-
Notifications
You must be signed in to change notification settings - Fork 9
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
New demo for dog mode props and cmds #18
Conversation
samples/mixed/consumer/src/main.rs
Outdated
|
||
server_future.await?; | ||
|
||
info!("The Consumer has conmpleted."); |
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.
typo in completed
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.
Fixed.
tokio::spawn(async move { | ||
let mut response_payload: String = format!("Successfully invoked {entity_id}"); | ||
|
||
if entity_id == ACTIVATE_AIR_CONDITIOING { |
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.
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 has a compile time error, as match does not work with string slices.
Also, this is a personal preference thing. I'm leaving it as is.
|
||
// Update the A/C's use of the battery. | ||
if self.is_air_conditioning_active && self.hybrid_battery_remaining > 0.0 { | ||
self.hybrid_battery_remaining -= 0.10; |
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.
maybe not deal with floats at all? why not used fixed-point values with 2 digits after the decimal point?
floats are unpredictable on different architectures
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.
Good point. Fixed.
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.
how is this fixed? it is still a float.
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.
Yep, was looking at the outdated file. Apologies for the confusion. Ignore my previous comment.
Alex Recommends ReportAlex recommends the following language changes, but Alex is a regular expression based algorithm, so take them with a grain of salt. ✨ 🚀 ✨ Nothing to Report ✨ 🚀 ✨ |
Some comments from previous iteration(s) have not been responded to. |
…moForDogModePropsAndCmds New demo for dog mode props and cmds
No description provided.