spike.statuslight

Hub status light mock API

Classes

StatusLight()

Hub status light mocking class

class spike.statuslight.StatusLight

Hub status light mocking class

Class is accessed simultaneously by the user side thread and the ground truth update thread. It is therefore protected by a mutex

__init__()

Contructor

on(color='white')

Sets the color of the light

Parameters:

color (string) – the light color

Raises:
  • TypeError – color is not a string

  • ValueError – color is not one of the allowed values

off()

Turns off the light

__process_command(command)

Process command until over

Parameters:

command (generator function) – command to process

c_reset()

Reset function

Warning

This function is not part of the spike API. It is provided to update the component from scenario data and shall not be used by the end-user.

c_on(color)

Switch on function

Warning

This function is not part of the spike API. It is provided to update the component from scenario data and shall not be used by the end-user.

Parameters:

color (string) – The light color

c_off()

Switch off function

Warning

This function is not part of the spike API. It is provided to update the component from scenario data and shall not be used by the end-user.

c_get_color()

Returns current color

Warning

This function is not part of the spike API. It is provided to update the component from scenario data and shall not be used by the end-user.

Returns:

the light current color

Return type:

string

c_get_status()

Returns current status

Warning

This function is not part of the spike API. It is provided to update the component from scenario data and shall not be used by the end-user.

Returns:

True if light is on, false otherwise

Return type:

string