From 58ecadf4b8ca99b2b98e74e0ad1d58e4005ed00b Mon Sep 17 00:00:00 2001 From: Doug Lau Date: Mon, 2 Dec 2024 15:10:31 -0600 Subject: [PATCH] honeybee / bulb: Add controller status --- bulb/src/controller.rs | 7 +++++++ honeybee/src/query.rs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bulb/src/controller.rs b/bulb/src/controller.rs index c837c969d..0f187ba1f 100644 --- a/bulb/src/controller.rs +++ b/bulb/src/controller.rs @@ -47,6 +47,12 @@ pub struct Setup { pub version: Option, } +/// Optional status data +#[derive(Debug, Default, Deserialize, PartialEq)] +pub struct ControllerStatus { + pub faults: Option, +} + /// Controller #[derive(Debug, Default, Deserialize, PartialEq)] pub struct Controller { @@ -58,6 +64,7 @@ pub struct Controller { pub condition: u32, pub notes: Option, pub setup: Option, + pub status: Option, pub fail_time: Option, // secondary attributes pub geo_loc: Option, diff --git a/honeybee/src/query.rs b/honeybee/src/query.rs index 68184e3b9..03e8187d0 100644 --- a/honeybee/src/query.rs +++ b/honeybee/src/query.rs @@ -166,7 +166,7 @@ pub const CONTROLLER_ALL: &str = "\ /// SQL query for one controller (secondary) pub const CONTROLLER_ONE: &str = "\ SELECT c.name, location, geo_loc, comm_link, drop_id, cabinet_style, \ - condition, notes, password, setup, fail_time \ + condition, notes, password, setup, status, fail_time \ FROM iris.controller c \ LEFT JOIN geo_loc_view gl ON c.geo_loc = gl.name \ WHERE c.name = $1";