4 Commits

Author SHA1 Message Date
b43b27a17e Merge pull request 'Update Rust crate reqwest to 0.12.25' (#385) from renovate/reqwest-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-12 00:37:06 +00:00
9a7cabe4a7 Update Rust crate reqwest to 0.12.25
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-12-10 00:36:45 +00:00
0d1baac2b7 Merge branch 'master' of ssh://gitea.communiquons.org:52001/pierre/SolarEnergy
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-09 18:22:50 +01:00
eae781a613 Fix bad default value 2025-12-09 19:22:25 +01:00
3 changed files with 10 additions and 8 deletions

View File

@@ -2615,9 +2615,9 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
[[package]]
name = "reqwest"
version = "0.12.24"
version = "0.12.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
checksum = "b6eff9328d40131d43bd911d42d79eb6a47312002a4daefc9e37f17e74a7701a"
dependencies = [
"base64 0.22.1",
"bytes",
@@ -3335,9 +3335,9 @@ dependencies = [
[[package]]
name = "tower-http"
version = "0.6.7"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cf146f99d442e8e68e585f5d798ccd3cad9a7835b917e09728880a862706456"
checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
dependencies = [
"bitflags",
"bytes",

View File

@@ -19,7 +19,7 @@ asn1 = "0.23.0"
actix-web = { version = "4.12.1", features = ["openssl"] }
futures = "0.3.31"
serde = { version = "1.0.228", features = ["derive"] }
reqwest = { version = "0.12.24", features = ["json"] }
reqwest = { version = "0.12.25", features = ["json"] }
serde_json = "1.0.145"
rand = "0.10.0-rc.5"
actix = "0.13.5"

View File

@@ -79,7 +79,7 @@ pub struct FullRelayState {
/// Required uptime during a day (in seconds)
daily_requirement: Option<usize>,
/// Forced relay state
relay_forced_state: RelayForcedState,
forced_state: RelayForcedState,
}
#[derive(serde::Serialize)]
@@ -117,6 +117,8 @@ pub async fn relays_full_state(energy_actor: WebEnergyActor) -> HttpResult {
.expect("All relay shall have an associated device!");
let device_state = devices_state.iter().find(|s| s.id == device.id);
let relay_state = relays_state.iter().find(|s| s.id == r.id);
let total_uptime = relay_state_history::relay_total_runtime_adjusted(&r);
FullRelayState {
enabled: r.enabled && device.enabled,
online: device_state.map(|d| d.online).unwrap_or(false),
@@ -124,9 +126,9 @@ pub async fn relays_full_state(energy_actor: WebEnergyActor) -> HttpResult {
name: r.name,
priority: r.priority,
r#for: relay_state.map(|s| s.r#for).unwrap_or(0),
total_uptime: 0,
total_uptime,
daily_requirement: r.daily_runtime.map(|r| r.min_runtime),
relay_forced_state: relay_state
forced_state: relay_state
.map(|s| s.forced_state.clone())
.unwrap_or_default(),
}