Similar blocks of code found in 4 locations. Consider refactoring.
def brightness(value)
raise ArgumentError, "Please supply a brightness value between 0-100." if value.negative? || value > 100
@command.execute(0, [0x31, 0x00, 0x00, 0x08, 0x03, value, 0x00, 0x00, 0x00])
Similar blocks of code found in 4 locations. Consider refactoring.
def brightness(value)
raise ArgumentError, "Please supply a brightness value between 0-100." if value.negative? || value > 100
@command.execute(1, [0x31, 0x00, 0x00, 0x00, 0x02, value, 0x00, 0x00, 0x00])
Similar blocks of code found in 3 locations. Consider refactoring.
def saturation(value)
raise ArgumentError, "Please supply a saturation value between 0-100." if value.negative? || value > 100
@command.execute(zone_id, [0x31, 0x00, 0x00, 0x08, 0x02, value, 0x00, 0x00, 0x00])
Similar blocks of code found in 2 locations. Consider refactoring.
def hue(value)
raise ArgumentError, "Please supply a hue value between 0-255." if value.negative? || value > 255
@command.execute(1, [0x31, 0x00, 0x00, 0x00, 0x01, value, value, value, value])
Similar blocks of code found in 2 locations. Consider refactoring.
def hue(value)
raise ArgumentError, "Please supply a hue value between 0-255." if value.negative? || value > 255
@command.execute(0, [0x31, 0x00, 0x00, 0x08, 0x01, value, value, value, value])
Similar blocks of code found in 4 locations. Consider refactoring.
def temperature(value)
raise ArgumentError, "Please supply a temperature value between 0-100 (2700K to 6500K)." if value.negative? || value > 100
@command.execute(0, [0x31, 0x00, 0x00, 0x08, 0x05, value, 0x00, 0x00, 0x00])
Similar blocks of code found in 3 locations. Consider refactoring.
def temperature(value)
raise ArgumentError, "Please supply a temperature value between 0-100 (2700K to 6500K)." if value.negative? || value > 100
@command.execute(zone_id, [0x31, 0x00, 0x00, 0x08, 0x05, value, 0x00, 0x00, 0x00])
Similar blocks of code found in 3 locations. Consider refactoring.
def brightness(value)
raise ArgumentError, "Please supply a brightness value between 0-100." if value.negative? || value > 100
@command.execute(zone_id, [0x31, 0x00, 0x00, 0x08, 0x03, value, 0x00, 0x00, 0x00])
Similar blocks of code found in 4 locations. Consider refactoring.
def saturation(value)
raise ArgumentError, "Please supply a saturation value between 0-100." if value.negative? || value > 100
@command.execute(0, [0x31, 0x00, 0x00, 0x08, 0x02, value, 0x00, 0x00, 0x00])