further components and bootstrap initial
This commit is contained in:
@@ -515,7 +515,8 @@ impl PlantCtrlBoard<'_> {
|
||||
}
|
||||
|
||||
pub fn wifi_ap(&mut self, ap_ssid: Option<heapless::String<32>>) -> Result<()> {
|
||||
let ssid = ap_ssid.unwrap_or(heapless::String::from_str("PlantCtrl Emergency Mode").unwrap());
|
||||
let ssid =
|
||||
ap_ssid.unwrap_or(heapless::String::from_str("PlantCtrl Emergency Mode").unwrap());
|
||||
let apconfig = AccessPointConfiguration {
|
||||
ssid,
|
||||
auth_method: AuthMethod::None,
|
||||
@@ -644,7 +645,6 @@ impl PlantCtrlBoard<'_> {
|
||||
}
|
||||
|
||||
pub fn get_rtc_time(&mut self) -> Result<DateTime<Utc>> {
|
||||
|
||||
match self.rtc.datetime() {
|
||||
OkStd(rtc_time) => {
|
||||
return Ok(rtc_time.and_utc());
|
||||
@@ -757,7 +757,6 @@ impl PlantCtrlBoard<'_> {
|
||||
bail!("Mqtt url was empty")
|
||||
}
|
||||
|
||||
|
||||
let last_will_topic = format!("{}/state", base_topic);
|
||||
let mqtt_client_config = MqttClientConfiguration {
|
||||
lwt: Some(LwtConfiguration {
|
||||
@@ -835,20 +834,19 @@ impl PlantCtrlBoard<'_> {
|
||||
}
|
||||
esp_idf_svc::mqtt::client::EventPayload::BeforeConnect => {
|
||||
println!("Mqtt before connect")
|
||||
},
|
||||
}
|
||||
esp_idf_svc::mqtt::client::EventPayload::Subscribed(_) => {
|
||||
println!("Mqtt subscribed")
|
||||
},
|
||||
}
|
||||
esp_idf_svc::mqtt::client::EventPayload::Unsubscribed(_) => {
|
||||
println!("Mqtt unsubscribed")
|
||||
},
|
||||
}
|
||||
esp_idf_svc::mqtt::client::EventPayload::Published(_) => {
|
||||
println!("Mqtt published")
|
||||
},
|
||||
}
|
||||
esp_idf_svc::mqtt::client::EventPayload::Deleted(_) => {
|
||||
println!("Mqtt deleted")
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
})?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user