This commit is contained in:
Mateusz Gruszczyński committed 2026-09-17 11:21:49 +02:00
1 parent 32f8a32bd2
commit df10ead47e
38 files changed
+655 -210

No files matched your search

+14
View File
@@ -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()));