<commit_before>module LEDENET
  class Api
    API_PORT = 5577

    DEFAULT_OPTIONS = {
        reuse_connection: false,
        max_retries: 3
    }

    def initialize(device_address, options = {})
      @device_address = device_address
      @options = DEFAULT_OPTIONS.merge(options)
    end

    def on
      send_bytes_action(0x71, 0x23, 0x0F, 0xA3)

      true
    end

    def off
      send_bytes_action(0x71, 0x24 ,0x0F, 0xA4)

      true
    end

    def on?
      (status.bytes[13] & 0x01) == 1
    end

    def update_color(r, g, b)
      checksum = color_checksum(r, g, b)

      send_bytes_action(0x31, r, g, b, 0xFF, 0, 0x0F, checksum)
    end

    def current_color
      status.bytes[6, 3]
    end
<commit_msg>return true in update_color too<commit_after>module LEDENET
  class Api
    API_PORT = 5577

    DEFAULT_OPTIONS = {
        reuse_connection: false,
        max_retries: 3
    }

    def initialize(device_address, options = {})
      @device_address = device_address
      @options = DEFAULT_OPTIONS.merge(options)
    end

    def on
      send_bytes_action(0x71, 0x23, 0x0F, 0xA3)

      true
    end

    def off
      send_bytes_action(0x71, 0x24 ,0x0F, 0xA4)

      true
    end

    def on?
      (status.bytes[13] & 0x01) == 1
    end

    def update_color(r, g, b)
      checksum = color_checksum(r, g, b)

      send_bytes_action(0x31, r, g, b, 0xFF, 0, 0x0F, checksum)

      true
    end

    def current_color
      status.bytes[6, 3]
    end

{'fraction_non_alphanumeric': 0.08636977058029689, 'fraction_numerical': 0.05398110661268556, 'mean_word_length': 2.203023758099352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6094025', 'n_tokens_mistral': 611, 'n_tokens_neox': 549, 'n_words': 131}