Lights

State

Front exterior light

Declaration

getFrontExteriorLight()

Example

val state:Lights.State
assertTrue(state.frontExteriorLight.value == Lights.FrontExteriorLight.ACTIVE_WITH_FULL_BEAM)
// Front exterior lights are active with full beam

Rear exterior light

Declaration

getRearExteriorLight()

Example

val state:Lights.State
assertTrue(state.rearExteriorLight.value == ActiveState.ACTIVE)
// Rear exterior lights are active

Ambient light colour

Declaration

getAmbientLightColour()

Example

val state:Lights.State
assertTrue(state.ambientLightColour.value?.red == 255)
assertTrue(state.ambientLightColour.value?.green == 0)
assertTrue(state.ambientLightColour.value?.blue == 0)
// Ambient light is red

Reverse light

Declaration

getReverseLight()

Example

val state:Lights.State
assertTrue(state.reverseLight.value == ActiveState.INACTIVE)
// Reverse light is inactive

Emergency brake light

Declaration

getEmergencyBrakeLight()

Example

val state:Lights.State
assertTrue(state.emergencyBrakeLight.value == ActiveState.INACTIVE)
// Emergency brake light is inactive

Fog lights

Declaration

getFogLights()

Example

val state:Lights.State
assertTrue(state.fogLights[0].value?.location == LocationLongitudinal.FRONT)
assertTrue(state.fogLights[0].value?.state == ActiveState.INACTIVE)
// Front fog lights are inactive

Reading lamps

Declaration

getReadingLamps()

Example

val state:Lights.State
assertTrue(state.readingLamps[0].value?.location == Location.FRONT_LEFT)
assertTrue(state.readingLamps[0].value?.state == ActiveState.ACTIVE)
// Front left reading lamp is active

Interior lights

Declaration

getInteriorLights()

Example

val state:Lights.State
assertTrue(state.interiorLights[0].value?.location == LocationLongitudinal.FRONT)
assertTrue(state.interiorLights[0].value?.state == ActiveState.INACTIVE)
// Front interior lights are inactive

Switch position

Declaration

getSwitchPosition()

Discussion

Position of the rotary light switch

Example

val state:Lights.State
assertTrue(state.switchPosition.value == Lights.SwitchPosition.PARKING_LIGHT_RIGHT)
// Rotary light switch position parking light right

Setters

Control lights

Declaration

public ControlLights(@Nullable FrontExteriorLight frontExteriorLight, @Nullable ActiveState rearExteriorLight, @Nullable RgbColour ambientLightColour, @Nullable List<Light> fogLights, @Nullable List<ReadingLamp> readingLamps, @Nullable List<Light> interiorLights)

Example

val controlLights = Lights.ControlLights(Lights.FrontExteriorLight.ACTIVE_WITH_FULL_BEAM, ActiveState.ACTIVE, RgbColour(255, 0, 0), 
    arrayListOf(
        Light(LocationLongitudinal.FRONT, ActiveState.INACTIVE), 
        Light(LocationLongitudinal.REAR, ActiveState.ACTIVE))
    , 
    arrayListOf(
        ReadingLamp(Location.FRONT_LEFT, ActiveState.ACTIVE), 
        ReadingLamp(Location.FRONT_RIGHT, ActiveState.ACTIVE), 
        ReadingLamp(Location.REAR_RIGHT, ActiveState.INACTIVE), 
        ReadingLamp(Location.REAR_LEFT, ActiveState.INACTIVE))
    , 
    arrayListOf(
        Light(LocationLongitudinal.FRONT, ActiveState.INACTIVE), 
        Light(LocationLongitudinal.REAR, ActiveState.ACTIVE))
    )    

Getters

Get Lights property availability information

Declaration

public GetStateAvailability()
public GetStateAvailability(byte... propertyIdentifiers)

Example

// get all property availabilities
val getAvailability = GetStateAvailability()
// get frontExteriorLight and rearExteriorLight property availabilities
val getAvailabilityProperties = GetStateAvailability(0x01, 0x02)

Get Lights properties

Declaration

public GetState()
public GetState(byte... propertyIdentifiers)            

Example

// get all properties
val getState = GetState()
// get frontExteriorLight and rearExteriorLight properties
val getStateProperties = GetState(0x01, 0x02)