mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-06-03 08:34:21 +02:00
dont set empty name
This commit is contained in:
parent
7b8786919c
commit
67849be3f6
1 changed files with 4 additions and 1 deletions
|
|
@ -105,7 +105,10 @@ async fn mqtt_client(host: &str, port: u16, device_states: DeviceStates) -> Resu
|
|||
if let Ok(json) = json::parse(payload) {
|
||||
let mut device_state = device_states.entry(device).or_default();
|
||||
if json["DeviceName"].is_string() {
|
||||
device_state.name = json["DeviceName"].to_string();
|
||||
let name = json["DeviceName"].to_string();
|
||||
if !name.is_empty() {
|
||||
device_state.name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue