summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLHeadLampStatus.m
blob: db20b156646526f2e7e855fc1b53c76a8038bc8f (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
//  SDLHeadLampStatus.m
//

#import "SDLHeadLampStatus.h"

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


@implementation SDLHeadLampStatus

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

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

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

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

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

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

@end