BluetoothDevice.fromJson(Map<String, dynamic> json) : id = DeviceIdentifier(json['id']), name = json['name'], type = BluetoothDeviceType.values[json['type']];