Sha256: 6e85109dd93b8025628564e1bd88e1278d12834bc65de6d16e32a0c5be8a22d9

Contents?: true

Size: 475 Bytes

Versions: 2

Compression:

Stored size: 475 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "milight/v6"

if ARGV.length < 2
  puts "Usage: #{$PROGRAM_NAME} <host> <command> [zone]"
  exit 1
end

host = ARGV.shift
command = ARGV.shift
zone = ARGV.shift

controller = Milight::V6::Controller.new(host)

if zone.nil?
  lights = controller.all
else
  lights = controller.zone(zone.to_i)
end

case command
when "link"
  lights.link
when "unlink"
  lights.unlink
when "off"
  lights.off
when "on"
  lights.on
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
milight-v6-0.1.1 bin/milight
milight-v6-0.1.0 bin/milight