class Tinkerforge::BrickletColorV2

Constants

GAINS
INTEGRATION_TIMES

Public Instance Methods

blackout() click to toggle source

Switches off the Bricklet's white LED.

# File lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.rb, line 9
def blackout
  set_light false
  true
end
state() click to toggle source

Returns the device's state.

Calls superclass method
# File lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.rb, line 15
def state
  super.merge(
    'configuration'     => config = get_configuration,
    'gain'              => GAINS[ config[0] ],
    'integration_time'  => INTEGRATION_TIMES[ config[1] ],
    'color_rgbc'        => color = get_color,
    'illuminance_raw'   => illum = get_illuminance,
    'illuminance'       => illum * 700.0 / GAINS[ config[0] ] / INTEGRATION_TIMES[ config[1] ],
    'color_temperature' => get_color_temperature,
    'saturated'         => color[0,3].include?(65535),
    'light'             => get_light,
  )
end