mirror of
https://codeberg.org/icewind/tasmota-mqtt-client.git
synced 2026-06-03 18:24:09 +02:00
cleanup discovery output
This commit is contained in:
parent
cdead1c9ef
commit
35e7029e60
1 changed files with 6 additions and 4 deletions
10
src/lib.rs
10
src/lib.rs
|
|
@ -60,12 +60,14 @@ impl TasmotaClient {
|
|||
|
||||
match payload {
|
||||
"Online" => {
|
||||
edit_devices.lock().unwrap().insert(device.into());
|
||||
let _ = tx.send(DeviceUpdate::Added(device.into()));
|
||||
if edit_devices.lock().unwrap().insert(device.into()) {
|
||||
let _ = tx.send(DeviceUpdate::Added(device.into()));
|
||||
}
|
||||
}
|
||||
"Offline" => {
|
||||
edit_devices.lock().unwrap().remove(device);
|
||||
let _ = tx.send(DeviceUpdate::Removed(device.into()));
|
||||
if edit_devices.lock().unwrap().remove(device) {
|
||||
let _ = tx.send(DeviceUpdate::Removed(device.into()));
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue