Class: LIFX::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/lifx/console.rb,
lib/lifx/console/version.rb,
lib/lifx/console/identify.rb

Defined Under Namespace

Modules: Commands Classes: Identify

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.clientObject


9
10
11
12
13
14
# File 'lib/lifx/console.rb', line 9

def client
  @client ||= LIFX::Client.lan.tap do |c|
    c.extend(LIFX::Colors)
    c.extend(Commands)
  end
end

.startObject


16
17
18
19
20
21
22
23
24
# File 'lib/lifx/console.rb', line 16

def start
  begin
    client.discover!
  rescue LIFX::Client::DiscoveryTimeout
    $stderr.puts("Could not find any LIFX devices.")
    exit 1
  end
  client.pry
end