getThermostatDetails static method

Future<Device> getThermostatDetails(
  1. Request request,
  2. String id
)

Implementation

static Future<Device> getThermostatDetails(Request request, String id) async {
  final device = await getDeviceDetails(request, id);
  // For now thermostatDeviceTrait is device with only lock trait so stripping
  // out all the other traits
  final thermostatDeviceTrait =
      device.traits.whereType<ThermostatTrait>().toList();
  final thermostatDevice = Device(
      device.id,
      device.displayName,
      device.description,
      device.manufacturerName,
      device.model,
      device.serialNumber,
      device.createdAt,
      device.updatedAt,
      thermostatDeviceTrait);
  return thermostatDevice;
}