blob: 80624221dcc2de5b48dab863977e901c7cc30f99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// SDLLightControlData.m
//
#import "SDLLightControlData.h"
#import "SDLRPCParameterNames.h"
#import "NSMutableDictionary+Store.h"
#import "SDLLightState.h"
NS_ASSUME_NONNULL_BEGIN
@implementation SDLLightControlData
-(instancetype)initWithLightStates:(NSArray<SDLLightState *> *)lightState {
self = [self init];
if(!self) {
return nil;
}
self.lightState = lightState;
return self;
}
- (void)setLightState:(NSArray<SDLLightState *> *)lightState {
[store sdl_setObject:lightState forName:SDLRPCParameterNameLightState];
}
- (NSArray<SDLLightState *> *)lightState {
NSError *error;
return [store sdl_objectsForName:SDLRPCParameterNameLightState ofClass:SDLLightState.class error:&error];
}
@end
NS_ASSUME_NONNULL_END
|