refactor: move LightState struct to mqtt module
This commit is contained in:
@@ -100,21 +100,6 @@ impl WaitType {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Default)]
|
||||
/// Light State tracking data for mqtt
|
||||
struct LightState {
|
||||
/// is enabled in config
|
||||
enabled: bool,
|
||||
/// led is on
|
||||
active: bool,
|
||||
/// led should not be on at this time of day
|
||||
out_of_work_hour: bool,
|
||||
/// the battery is low so do not use led
|
||||
battery_low: bool,
|
||||
/// the sun is up
|
||||
is_day: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Default)]
|
||||
///mqtt struct to track pump activities
|
||||
struct PumpInfo {
|
||||
@@ -467,7 +452,7 @@ async fn safe_main(spawner: Spawner) -> FatResult<()> {
|
||||
.unwrap_or(BatteryState::Unknown);
|
||||
|
||||
info!("Battery state is {:?}", battery_state);
|
||||
let mut light_state = LightState {
|
||||
let mut light_state = mqtt::LightState {
|
||||
enabled: board.board_hal.get_config().night_lamp.enabled,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user