summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLHeadLampStatus.m
blob: b203450b6f87a7856ae0711878cc6dc502ad7cb9 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//  SDLHeadLampStatus.m
//

#import "SDLHeadLampStatus.h"

#import "SDLAmbientLightStatus.h"
#import "SDLNames.h"

@implementation SDLHeadLampStatus

- (instancetype)init {
    if (self = [super init]) {
    }
    return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
    if (self = [super initWithDictionary:dict]) {
    }
    return self;
}

- (void)setLowBeamsOn:(NSNumber *)lowBeamsOn {
    if (lowBeamsOn != nil) {
        [store setObject:lowBeamsOn forKey:SDLNameLowBeamsOn];
    } else {
        [store removeObjectForKey:SDLNameLowBeamsOn];
    }
}

- (NSNumber *)lowBeamsOn {
    return [store objectForKey:SDLNameLowBeamsOn];
}

- (void)setHighBeamsOn:(NSNumber *)highBeamsOn {
    if (highBeamsOn != nil) {
        [store setObject:highBeamsOn forKey:SDLNameHighBeamsOn];
    } else {
        [store removeObjectForKey:SDLNameHighBeamsOn];
    }
}

- (NSNumber *)highBeamsOn {
    return [store objectForKey:SDLNameHighBeamsOn];
}

- (void)setAmbientLightSensorStatus:(SDLAmbientLightStatus *)ambientLightSensorStatus {
    if (ambientLightSensorStatus != nil) {
        [store setObject:ambientLightSensorStatus forKey:SDLNameAmbientLightSensorStatus];
    } else {
        [store removeObjectForKey:SDLNameAmbientLightSensorStatus];
    }
}

- (SDLAmbientLightStatus *)ambientLightSensorStatus {
    NSObject *obj = [store objectForKey:SDLNameAmbientLightSensorStatus];
    if (obj == nil || [obj isKindOfClass:SDLAmbientLightStatus.class]) {
        return (SDLAmbientLightStatus *)obj;
    } else {
        return [SDLAmbientLightStatus valueOf:(NSString *)obj];
    }
}

@end