File tree Expand file tree Collapse file tree
dConnectDevicePlugin/dConnectDeviceIRKit/dConnectDeviceIRKit/Classes/profile Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ - (id) initWithDevicePlugin:(DPIRKitDevicePlugin *)plugin
7575 @" Parameter 'flashing' invalid." ];
7676 return YES ;
7777 }
78+ NSString *brightnessString = [request stringForKey: @" brightness" ];
79+ if ((brightnessString && [brightnessString length ] == 0 ) || (brightness && ([brightness doubleValue ] < 0.0 || [brightness doubleValue ] > 1.0 ))) {
80+ [response setErrorToInvalidRequestParameterWithMessage:
81+ @" Parameter 'brightness' must be a value between 0 and 1.0." ];
82+ return YES ;
83+ }
7884 if (![weakSelf checkFlash: response flashing: flashing]) {
7985 return YES ;
8086 }
@@ -143,7 +149,7 @@ - (BOOL)sendLightIRRequestWithServiceId:(NSString *)serviceId
143149 [response setErrorToNotSupportProfile ];
144150 return send;
145151 }
146- if (!lightId || (lightId && ![lightId isEqualToString: @" 1" ])) {
152+ if ((lightId && ![lightId isEqualToString: @" 1" ])) {
147153 [response setErrorToInvalidRequestParameterWithMessage: @" Invalid lightId" ];
148154 return send;
149155 }
You can’t perform that action at this time.
0 commit comments