clippy adjustments
This commit is contained in:
@@ -1123,24 +1123,24 @@ fn update_plant_state(
|
||||
}
|
||||
}
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/active", plant + 1).as_str(),
|
||||
state.active.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Sensor A", plant + 1).as_str(),
|
||||
option_to_string(state.a).as_bytes(),
|
||||
);
|
||||
if plant_config.sensor_b {
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Sensor B", plant + 1).as_str(),
|
||||
option_to_string(state.b).as_bytes(),
|
||||
);
|
||||
} else {
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Sensor B", plant + 1).as_str(),
|
||||
"disabled".as_bytes(),
|
||||
);
|
||||
@@ -1148,70 +1148,70 @@ fn update_plant_state(
|
||||
|
||||
if plant_config.sensor_p {
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Sensor P before", plant + 1).as_str(),
|
||||
option_to_string(state.p).as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Sensor P after", plant + 1).as_str(),
|
||||
option_to_string(state.after_p).as_bytes(),
|
||||
);
|
||||
} else {
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Sensor P before", plant + 1).as_str(),
|
||||
"disabled".as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Sensor P after", plant + 1).as_str(),
|
||||
"disabled".as_bytes(),
|
||||
);
|
||||
}
|
||||
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Should water", plant + 1).as_str(),
|
||||
state.do_water.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Is frozen", plant + 1).as_str(),
|
||||
state.frozen.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Is dry", plant + 1).as_str(),
|
||||
state.dry.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Pump Error", plant + 1).as_str(),
|
||||
state.pump_error.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Pump Ineffective", plant + 1).as_str(),
|
||||
state.not_effective.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Is in Cooldown", plant + 1).as_str(),
|
||||
state.cooldown.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/No Water", plant + 1).as_str(),
|
||||
state.no_water.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/Out of Work Hour", plant + 1).as_str(),
|
||||
state.out_of_work_hour.to_string().as_bytes(),
|
||||
);
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
config,
|
||||
format!("/plant{}/consecutive pump count", plant + 1).as_str(),
|
||||
state.consecutive_pump_count.to_string().as_bytes(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user