getLightState method
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;
}
}