Skip to content

Commit

Permalink
honeybee / bulb: Add controller status
Browse files Browse the repository at this point in the history
  • Loading branch information
DougLau committed Dec 2, 2024
1 parent d7e9950 commit 58ecadf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bulb/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ pub struct Setup {
pub version: Option<String>,
}

/// Optional status data
#[derive(Debug, Default, Deserialize, PartialEq)]
pub struct ControllerStatus {
pub faults: Option<String>,
}

/// Controller
#[derive(Debug, Default, Deserialize, PartialEq)]
pub struct Controller {
Expand All @@ -58,6 +64,7 @@ pub struct Controller {
pub condition: u32,
pub notes: Option<String>,
pub setup: Option<Setup>,
pub status: Option<ControllerStatus>,
pub fail_time: Option<String>,
// secondary attributes
pub geo_loc: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion honeybee/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 58ecadf

Please sign in to comment.