Class: Wizrb::Lighting::Events::SetRgbEvent

Inherits:
Shared::Events::Base show all
Defined in:
lib/wizrb/lighting/events/set_rgb_event.rb

Constant Summary collapse

MIN_VALUE =
1
MAX_VALUE =
255

Instance Attribute Summary

Attributes inherited from Shared::Events::Base

#params

Instance Method Summary collapse

Methods inherited from Shared::Events::Base

#to_json

Constructor Details

#initialize(red, green, blue) ⇒ SetRgbEvent

Returns a new instance of SetRgbEvent.



12
13
14
15
16
17
# File 'lib/wizrb/lighting/events/set_rgb_event.rb', line 12

def initialize(red, green, blue)
  validate_color!("Red", red)
  validate_color!("Green", green)
  validate_color!("Blue", blue)
  super(method: "setState", params: {r: red, g: green, b: blue})
end