getLightState method

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

Implementation

Future<Map<String, dynamic>> getLightState(String serialNumber) async {
  try {
    return await this._getDeviceState(
        serialNumber, constants['stateAttributes']!['lightState'] 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 light',
          'Invalid Device');
    }
    throw e;
  }
}