4 Commits

Author SHA1 Message Date
14f17d49df Use tagged version of iot_tools/updater 2025-01-11 05:55:32 +01:00
01738df95c Added missing functions to structs 2025-01-11 05:46:23 +01:00
2f89c58f95 Bump version 2025-01-11 05:32:56 +01:00
032d785d60 Added upload script 2025-01-11 05:32:11 +01:00
4 changed files with 32 additions and 4 deletions

5
Cargo.lock generated
View File

@@ -13,7 +13,7 @@ dependencies = [
[[package]]
name = "air_filter"
version = "0.3.0"
version = "0.4.2"
dependencies = [
"bme280",
"cfg-if",
@@ -1889,7 +1889,8 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "updater"
version = "0.1.0"
version = "0.2.0"
source = "git+https://git.huizinga.dev/Dreaded_X/iot_tools?tag=v0.2.0#ce96dd0a4ef3cffe1c6be6786b0a47cdb412f861"
dependencies = [
"cortex-m",
"defmt",

View File

@@ -1,6 +1,6 @@
[package]
name = "air_filter"
version = "0.3.0"
version = "0.4.2"
edition = "2021"
[dependencies]
@@ -67,7 +67,7 @@ nourl = { version = "0.1", features = ["defmt"] }
smoltcp = { version = "0.12", default-features = false, features = [
"dns-max-server-count-4",
] }
updater = { version = "0.1.0", path = "../iot_tools/updater" }
updater = { git = "https://git.huizinga.dev/Dreaded_X/iot_tools", tag = "v0.2.0" }
portable-atomic = { version = "1.6", features = ["critical-section"] }
bme280 = { version = "0.5.0", features = ["async", "defmt"] }
picoserve = { version = "0.13.3", features = ["defmt", "embassy"] }

View File

@@ -26,6 +26,14 @@ impl FanState {
pub fn new(speed: FanSpeed, manual: bool) -> Self {
Self { speed, manual }
}
pub fn speed(&self) -> FanSpeed {
self.speed
}
pub fn manual(&self) -> bool {
self.manual
}
}
#[derive(Deserialize)]
@@ -34,6 +42,10 @@ pub struct SetFanSpeed {
}
impl SetFanSpeed {
pub fn new(speed: FanSpeed) -> Self {
Self { speed }
}
pub fn speed(&self) -> FanSpeed {
self.speed
}
@@ -54,4 +66,16 @@ impl SensorData {
pressure: measurements.pressure,
}
}
pub fn temperature(&self) -> f32 {
self.temperature
}
pub fn humidity(&self) -> f32 {
self.humidity
}
pub fn pressure(&self) -> f32 {
self.pressure
}
}

3
upload.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
curl -X PUT --data-binary "@./target/firmware/firmware+signed" airfilter.lan.huizinga.dev/firmware/update