mirror of
https://codeberg.org/icewind/wifi-prometheus-exporter.git
synced 2026-06-03 16:44:11 +02:00
retain config message
This commit is contained in:
parent
57b013f9e6
commit
249d9cd579
1 changed files with 4 additions and 5 deletions
|
|
@ -202,7 +202,7 @@ async fn send_update(
|
|||
.publish(
|
||||
format!("homeassistant/device_tracker/wifi-{}/config", mac),
|
||||
QoS::AtLeastOnce,
|
||||
false,
|
||||
true,
|
||||
format!(
|
||||
r#"{{
|
||||
"state_topic": "wifi-exporter/{mac}/state",
|
||||
|
|
@ -225,12 +225,11 @@ async fn send_update(
|
|||
.await?;
|
||||
let client = client.clone();
|
||||
spawn(async move {
|
||||
sleep(Duration::from_millis(1500)).await;
|
||||
client
|
||||
.publish(
|
||||
format!("wifi-exporter/{}/state", mac),
|
||||
QoS::AtLeastOnce,
|
||||
false,
|
||||
true,
|
||||
r#"connected"#,
|
||||
)
|
||||
.await
|
||||
|
|
@ -242,7 +241,7 @@ async fn send_update(
|
|||
.publish(
|
||||
format!("wifi-exporter/{}/state", mac),
|
||||
QoS::AtLeastOnce,
|
||||
false,
|
||||
true,
|
||||
r#"connected"#,
|
||||
)
|
||||
.await?;
|
||||
|
|
@ -252,7 +251,7 @@ async fn send_update(
|
|||
.publish(
|
||||
format!("wifi-exporter/{}/state", mac),
|
||||
QoS::AtLeastOnce,
|
||||
false,
|
||||
true,
|
||||
r#"disconnected"#,
|
||||
)
|
||||
.await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue