skip devices without name

This commit is contained in:
Robin Appelman 2021-02-07 20:31:24 +01:00
commit 2d7f5f7920

View file

@ -143,6 +143,10 @@ pub fn format_device_state<W: Write>(
state: &DeviceState,
mi_temp_names: &BTreeMap<BDAddr, String>,
) -> std::fmt::Result {
if state.name.is_empty() {
println!("{} has no name set, skipping", device.hostname);
return Ok(());
}
if let Some(switch_state) = state.state {
writeln!(
writer,