hue-cli 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5cd07631bec145ebd9eb5f2f81ded743ee26f13
4
- data.tar.gz: 76ffd9f8f9fc3466b3b9126a527a1a45d8abdd1c
3
+ metadata.gz: a573f5917df6a12bc3be00fa2a2974ce689b2600
4
+ data.tar.gz: de10f365721b4eca151744604adcbc7c26516339
5
5
  SHA512:
6
- metadata.gz: 43516b2457214e1300e43f24840fb68f3b352c32aa62a81ad6d72c6c097678a83c15a1051a1d4d93bc5b06762e649e4c30a8f1785f35cf402f7c239260f6955e
7
- data.tar.gz: e9370c0d8846ee6eb343aa8353a45da5341c0d075ba8389f9ec5a591f23bb477120952de609ed986e5f550afb945dec1bb0f953896579af2b3d5db97e4721afd
6
+ metadata.gz: b5f80f16eb38814890bd0d266097b06675a69ac5f69b54b8915dc16c9ed61b18e6a5d47846e080c52bd17192b0ac4c92c8bbd501e74a818e499de3a12f4eed6f
7
+ data.tar.gz: 47efdab517c8fb4e12ac33f32e9f8099ed9abf6ef633fb6a3317a5367387f4c50fe0de811e9dd105df2d81c9f7a10b3ed281e6347422354fc5c61e1898f09894
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ #gem "hue-lib", :path => "../hue-lib/" # For local dev.
4
+
3
5
  gemspec
data/bin/hue CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "#{File.dirname(__FILE__)}/../lib/hue/cli.rb"
3
+ require 'hue/cli'
4
4
 
5
5
  Hue::CLI.run(ARGV)
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "hue-cli"
6
- s.version = '0.1.3'
6
+ s.version = '0.1.4'
7
7
  s.authors = ["Birkir A. Barkarson", ""]
8
8
  s.email = ["birkirb@stoicviking.net"]
9
9
  s.homepage = "https://github.com/birkirb/hue-lib"
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.require_paths = ["lib"]
19
19
 
20
20
  s.add_runtime_dependency("json")
21
- s.add_runtime_dependency("hue-lib", '>= 0.7.3')
21
+ s.add_runtime_dependency("hue-lib", '>= 0.7.4')
22
22
  s.add_development_dependency("rspec", '>= 2.6.0')
23
23
  s.add_development_dependency("mocha", '>= 0.9.0')
24
24
  s.add_development_dependency("webmock", '>= 1.8.0')
@@ -0,0 +1,26 @@
1
+ module Hue
2
+ module CLI
3
+ module Commands
4
+ class Delete < Hue::CLI::Command
5
+
6
+ def execute(*args)
7
+ app_id = args.shift
8
+
9
+ if app_id.nil?
10
+ bridge.unregister
11
+ else
12
+ b = Bridge.new(app_id, bridge.bridge_uri)
13
+ b.unregister
14
+ end
15
+ end
16
+
17
+ protected
18
+
19
+ def default(*args)
20
+ Hue.register_default
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -31,14 +31,14 @@ module Hue
31
31
  puts "Applications:"
32
32
  indent do
33
33
  config['whitelist'].each do |key, values|
34
- puts "#{key} : #{values['name']}"
34
+ puts "#{'%-40s' % key} : #{values['name']}"
35
35
  end
36
36
  end
37
37
 
38
38
  puts "Lights:"
39
39
  indent do
40
40
  state['lights'].each do |key, values|
41
- puts " #{key}. #{values['name']} - #{values['state']['on'] ? 'ON' : 'OFF'}"
41
+ puts " #{'%2.3s' % key}. #{'%-30s' % values['name']} \t #{values['state']['on'] ? 'ON' : 'OFF'} \t #{values['modelid']} - #{values['type']}"
42
42
  end
43
43
  end
44
44
  end
@@ -9,7 +9,7 @@ module Hue
9
9
  puts "#{self.id}.".ljust(spaces) + "#{self.name}: #{self.on? ? 'ON' : 'OFF'}"
10
10
  indent(spaces) do
11
11
  puts "Brightness: #{self.brightness} (#{(self.brightness_percent).to_i}%)"
12
- puts "Color: #{self.color}, #{self.color.to_rgb}"
12
+ puts "Color: #{self.color}, #{self.color.to_rgb}" if self.state["hue"]
13
13
  transitory_state = [
14
14
  (self.transition_time > 0 ? "Transition time: #{self.transition_time} sec" : nil),
15
15
  (self.blinking? ? 'Alert: Blinking!' : nil),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hue-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Birkir A. Barkarson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-03 00:00:00.000000000 Z
12
+ date: 2017-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - '>='
33
33
  - !ruby/object:Gem::Version
34
- version: 0.7.3
34
+ version: 0.7.4
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '>='
40
40
  - !ruby/object:Gem::Version
41
- version: 0.7.3
41
+ version: 0.7.4
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +100,7 @@ files:
100
100
  - hue-cli.gemspec
101
101
  - lib/hue/cli.rb
102
102
  - lib/hue/cli/command.rb
103
+ - lib/hue/cli/commands/delete.rb
103
104
  - lib/hue/cli/commands/light.rb
104
105
  - lib/hue/cli/commands/lights.rb
105
106
  - lib/hue/cli/commands/register.rb