mirror of
https://codeberg.org/icewind/wifi-prometheus-exporter.git
synced 2026-06-03 16:44:11 +02:00
delay first connect mqtt message
This commit is contained in:
parent
537c02a31f
commit
b891a34e82
1 changed files with 13 additions and 8 deletions
|
|
@ -250,6 +250,9 @@ 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),
|
||||
|
|
@ -257,7 +260,9 @@ async fn send_update(
|
|||
false,
|
||||
r#"connected"#,
|
||||
)
|
||||
.await?;
|
||||
.await
|
||||
.ok();
|
||||
});
|
||||
}
|
||||
Update::Connected => {
|
||||
client
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue