similar method
Check whether this device has a matching id or name to another device instance.
Implementation
bool similar(DeviceState other) {
final props = [id, name];
return [
other.id,
other.name,
].any((p) => props.contains(p));
}