getDoorState method

Future<Map<String, dynamic>> getDoorState(
  1. String serialNumber
)

Implementation

Future<Map<String, dynamic>> getDoorState(String serialNumber) async {
  try {
    return await this._getDeviceState(
        serialNumber, constants['stateAttributes']!['doorState'] as String?);
  } on MyQError catch (e) {
    if (e.code == constants['codes']!['DEVICE_STATE_NOT_FOUND']) {
      throw MyQError(
          'device with serial number "$serialNumber" is not a door',
          'Invalid Device');
    }
    throw e;
  }
}