v0.15.0
This commit is contained in:
1 parent
32f8a32bd2
commit
df10ead47e
38 files changed
+655
-210
No files matched your search
@@ -392,6 +392,20 @@ pub(crate) fn validate_command(command: &DeviceCommand) -> Result<(), AppError>
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(value) = command.swing_vertical {
|
||||
if value > VERTICAL_SWING_MAX {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"vertical louver position must be between 0 and {VERTICAL_SWING_MAX}"
|
||||
)));
|
||||
}
|
||||
}
|
||||
if let Some(value) = command.swing_horizontal {
|
||||
if value > HORIZONTAL_SWING_MAX {
|
||||
return Err(AppError::BadRequest(format!(
|
||||
"horizontal louver position must be between 0 and {HORIZONTAL_SWING_MAX}"
|
||||
)));
|
||||
}
|
||||
}
|
||||
if let Some(value) = &command.mode {
|
||||
if !matches!(value.as_str(), "auto" | "cool" | "dry" | "fan" | "heat") {
|
||||
return Err(AppError::BadRequest("unsupported HVAC mode".into()));
|
||||
|
||||
Reference in new issue
Block a user