From 935d7094b58ef3a19e75b5f9415d6811026f158b Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 5 Jan 2025 21:06:00 +0100 Subject: [PATCH] Add optional field sensor.lastchange --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/server/routes/status.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0619ff..5baf830 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,7 +1064,7 @@ dependencies = [ [[package]] name = "spaceapi" version = "0.9.0" -source = "git+https://github.com/koarlchen/spaceapi-rs?branch=co2-v15#0dafa245ee3f5ecbeebb5b2b5f807df27a990928" +source = "git+https://github.com/koarlchen/spaceapi-rs?branch=v15#6cc1bc69af2a7f55ea8dcfc7195e157d86e95896" dependencies = [ "log", "serde", diff --git a/Cargo.toml b/Cargo.toml index 71e0155..1c3acb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["spaceapi", "hackspace", "k4cg"] [dependencies] # As of now, the spaceapi crate does not support the v15 schema. # Therefore we use a fork, where the required changes were already implemented. -spaceapi = { git = "https://github.com/koarlchen/spaceapi-rs", branch = "co2-v15" } +spaceapi = { git = "https://github.com/koarlchen/spaceapi-rs", branch = "v15" } influxdb = "0.7.2" serde = "1.0.217" serde_json = "1.0.134" diff --git a/src/server/routes/status.rs b/src/server/routes/status.rs index 90aecf5..f714e88 100644 --- a/src/server/routes/status.rs +++ b/src/server/routes/status.rs @@ -83,6 +83,7 @@ where unit: cfg.unit.clone(), metadata: sensors::SensorMetadataWithLocation { location: sensor.location.clone(), + lastchange: Some(value.time.timestamp() as u64), ..Default::default() }, }