Sha256: 741e09e8a40399316df9051e264a17d2c737a23da0348114c0d5712d02b01f99

Contents?: true

Size: 378 Bytes

Versions: 1

Compression:

Stored size: 378 Bytes

Contents

require 'socket'

module Milight
  class Commander

    def initialize(ip_address, port = 8899)
      @ip_address = ip_address
      @port = port
    end

    def send_command(cmd, arg1 = 0x00)
      socket = UDPSocket.new
      socket.send [cmd, arg1, 0x55].pack('C*'), 0, @ip_address, @port
      socket.close
    end

    def command_delay
      sleep 0.1
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
milight-easybulb-1.0.0 lib/milight/commander.rb