class Tinkerforge::BrickletRGBLEDV2
Public Instance Methods
blackout()
click to toggle source
Switches off the LED.
# File lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb, line 18 def blackout self.rgb = 0, 0, 0 true end
rgb()
click to toggle source
Returns the LED's current color as three values for red, green, and blue (integers in the range 0..255).
# File lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb, line 6 def rgb get_rgb_value end
rgb=(*rgb)
click to toggle source
Sets the LED's color using three values for red, green, and blue (integers in the range 0..255).
Values can be supplied as an array or as three separate values.
# File lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb, line 13 def rgb=(*rgb) set_rgb_value *rgb.flatten end
state()
click to toggle source
Returns the device's state.
Calls superclass method
# File lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb, line 24 def state super.merge( 'color_rgb' => get_rgb_value, ) end