xilight 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/yee +12 -7
  3. data/lib/xilight/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ab05093b44f3a72e57dcfa63e649be1aa6bd5128b9eea259b2619c8accb50ba
4
- data.tar.gz: d928c43a33666ccb9e572974e6a91594d9b9caf9ea50b05e9e6e2883f8b828a2
3
+ metadata.gz: 8bb65d34b1363b82bfaf5fbca8927b0de1d610aedf7b03e4d2d11ee4485c74c4
4
+ data.tar.gz: 196803f1a0a8a25faaf676f46a7d9f26ffec3381e255242b149bb95d9c630900
5
5
  SHA512:
6
- metadata.gz: 5ef46150fb68761ea29b368507cb95c74b4cd86aa110b7fb659b043fede7afa9d5b77aa59c46c913f66b138145cffce38ed0c4579ad020818762e2f8506873b7
7
- data.tar.gz: c0ba4f986549cd8fcb8961f24d04b2331746aecf27a8094dfc4119e978cbd73030c9b22f77dcc3d798ab2fd0bd2c325ecbf11dd245973ce255ff1deb660dc725
6
+ metadata.gz: 20b243d508aedca52d92db7ba0c7ef9acdbcd760fde640f7c9fa1f4dfb8ad2a810ba506f6a4f9c9cd1b32cf60876efa42c1fde6e726c4b6b516b27d2da911c76
7
+ data.tar.gz: 4647b5b21fd425fd926d7ebb6ea75eb565049e63e7421755f79134a220e762b0d34c044c12900aaf685de9433cd2f4cea79f164de6752120505c2600276d35fe
data/exe/yee CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "xilight"
4
4
  require "dry/cli"
5
-
5
+ require 'pry-byebug'
6
6
  module Xilight
7
7
  module CLI
8
8
 
@@ -51,10 +51,19 @@ module Xilight
51
51
 
52
52
  def self.discover
53
53
  ::Xilight::CLI.config = {
54
- 'yeelights' => ::Xilight::Yeelight.discover.each do |light|
54
+ 'yeelights' => ::Xilight::Yeelight.discover.map do |light|
55
55
  light.instance_variables.map{|v| [v.to_s[1..-1], light.instance_variable_get(v)] }.to_h
56
56
  end
57
57
  }
58
+ self.list
59
+ end
60
+
61
+ def self.list
62
+ current_config = ::Xilight::CLI.config
63
+ current_lights = current_config.fetch('yeelights', [])
64
+ current_lights.each_with_index do |light, index|
65
+ puts "Light ##{index} => #{(light['name'] || light['id'])}@#{light['host']}"
66
+ end
58
67
  end
59
68
 
60
69
  module Commands
@@ -92,11 +101,7 @@ module Xilight
92
101
  ]
93
102
 
94
103
  def call(**)
95
- current_config = ::Xilight::CLI.config
96
- current_lights = current_config.fetch('yeelights', [])
97
- current_lights.each_with_index do |light, index|
98
- puts "Light ##{index} => #{(light['name'] || light['id'])}@#{light['host']}"
99
- end
104
+ ::Xilight::CLI.list
100
105
  end
101
106
  end
102
107
 
@@ -1,3 +1,3 @@
1
1
  module Xilight
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xilight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters