This commit is contained in:
Robin Appelman 2021-11-28 22:42:11 +01:00
commit b531a8710e

View file

@ -215,11 +215,11 @@ async fn send_update(
Update::New => { Update::New => {
client client
.publish( .publish(
format!("home-assistant/device_tracker/wifi-{}/config", mac), format!("homeassistant/device_tracker/wifi-{}/config", mac),
QoS::AtLeastOnce, QoS::AtLeastOnce,
false, false,
format!( format!(
r#"{{"state_topic": "wifi-exporter/{mac}/state", "name": "Wifi device {mac}", "payload_home": "connected", "payload_not_home": "disconnected"}}"#, r#"{{"state_topic": "wifi-exporter/{mac}/state", "name": "Wifi device {mac}", " payload_available": "connected", " payload_not_available": "disconnected", "unique_id": "wifi-{mac}}}"#,
mac = mac mac = mac
) )
) )