Class: Tinkerforge::BrickletAmbientLightV3

Inherits:
Object
  • Object
show all
Defined in:
lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.rb

Constant Summary collapse

ILLUMINANCE_RANGES =
[ 64000, 32000, 16000, 8000, 1300, 600, 100000 ]

Instance Method Summary collapse

Instance Method Details

#stateObject

Returns the device’s state.



8
9
10
11
12
13
14
15
# File 'lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.rb', line 8

def state
  super.merge(
    'configuration'     => conf = get_configuration,
    'illuminance_range' => ILLUMINANCE_RANGES[ conf[0] ],
    'integration_time'  => 50 + conf[1] * 50,
    'illuminance_raw'   => get_illuminance,
  )
end