Class: Tinkerforge::BrickletMotionDetectorV2

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

Instance Method Summary collapse

Instance Method Details

#blackoutObject

Switches off all three blue backlight LEDs.



6
7
8
9
# File 'lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.rb', line 6

def blackout
  set_indicator(0, 0, 0)
  true
end

#stateObject

Returns the device’s state.



12
13
14
15
16
17
18
# File 'lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.rb', line 12

def state
  super.merge(
    'motion_detected' => get_motion_detected == 1,
    'sensitivity'     => get_sensitivity,
    'indicator'       => get_indicator,
  )
end