hue_switch 0.9.0 → 0.9.1

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: de98ca6559d56e0a56b9b9388f5b81b50ba92595
4
- data.tar.gz: 670efbf7d7ebe27988d7a7773d870d1ba41ef2cd
3
+ metadata.gz: 3bbfffc44ddbf35aee812168dabb5f946002ad91
4
+ data.tar.gz: 840003e4302e63d4773296ff84307ca8c4e534bb
5
5
  SHA512:
6
- metadata.gz: 7bb3d29d1fa11c37da5570de9fec03fff39260d95bf95b818a3cd75ab3b023a9dbf5566102a3e5a56045f5df352d6c2f6d18b490433650e114bd50ba68e88837
7
- data.tar.gz: 9dbd6c526a1c8dc25c3898f07b83deeef021c04dffd4cba7798ddece13137324dae04d2409523021980787dd38c54d97550c74113a0edc90ad0d2c7c84150004
6
+ metadata.gz: 1b9f3f11e09cb05b6e52fc6995b59f37ea4cbafce99e4497431b4db84529dbe4eb71ebc0596dc654ece0bfa5f59bf881f19d2d6d77bd939bfd8904ab5dc92fc9
7
+ data.tar.gz: 10b4102cee1c5e0c1c69861582994c19aad2e0eebc187d2525dbdc53a8f26e71bc4f7f9257c3db4ce0da860c095ed8b2bc84d58f3eb231c394a901aaa3792017
data/Gemfile.lock ADDED
@@ -0,0 +1,29 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ hue_switch (0.1.0)
5
+ chronic
6
+ chronic_duration
7
+ httparty
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ chronic (0.10.2)
13
+ chronic_duration (0.10.6)
14
+ numerizer (~> 0.1.1)
15
+ httparty (0.13.3)
16
+ json (~> 1.8)
17
+ multi_xml (>= 0.5.2)
18
+ json (1.8.2)
19
+ multi_xml (0.5.5)
20
+ numerizer (0.1.1)
21
+ rake (10.4.2)
22
+
23
+ PLATFORMS
24
+ ruby
25
+
26
+ DEPENDENCIES
27
+ bundler (~> 1.9)
28
+ hue_switch!
29
+ rake (~> 10.0)
data/README.md CHANGED
@@ -21,8 +21,6 @@ NOTE: The first time you run this gem, you'll need to press the link button on t
21
21
 
22
22
  Why is this different from other wrappers? Hue-Switch is not designed to give full access to Hue API, but to make access to basic operations super easy. A Hue Switch can be assigned an existing group, scene, or one or more individual lights. Switches can be scheduled easily. Color effects can be added (color loop, random colors, etc.) For example, a switch could be three random lights, rotating through random colors (or colors in a range.) If you turn the switch off, the lights go off. Turn it on, and they continue to cycle through colors.
23
23
 
24
- You'll need to replace USER constant with a string representing an authorized user on your Hue bridge.
25
-
26
24
  Colors can be specified by
27
25
 
28
26
  1. Color name (pink, red, blue, etc) including Hue color names (reading, energize, etc.)
Binary file
data/hue_switch.gemspec CHANGED
@@ -10,7 +10,9 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["sarkonovich@ at gmail dot com"]
11
11
 
12
12
  spec.summary = "A gem to easily control Hue lights"
13
- spec.homepage = "http://www.github.com/sarkonovich"
13
+ spec.description = "A 'switch' controls Hue lights, groups, or scenes. Switches can be scheduled, and given dynamic effects."
14
+ spec.homepage = "http://www.github.com/sarkonovich/Hue-Switch"
15
+ spec.licenses = [ 'MIT' ]
14
16
 
15
17
 
16
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -1,3 +1,3 @@
1
1
  module HueSwitch
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
data/lib/hue_switch.rb CHANGED
@@ -39,14 +39,12 @@ class Switch
39
39
  self.body.delete(:scene)
40
40
  self.body.delete(:ct)
41
41
  self.body[:hue] = numeric_value
42
- self.on
43
42
  end
44
43
 
45
44
  def mired (numeric_value)
46
45
  self.body.delete(:scene)
47
46
  self.body.delete(:hue)
48
47
  self.body[:ct] = numeric_value
49
- self.on
50
48
  end
51
49
 
52
50
  def color(color_name)
@@ -55,19 +53,16 @@ class Switch
55
53
  self.body.delete(:hue)
56
54
  @colors.keys.include?(color_name.to_sym) ?
57
55
  self.body[:hue] = @colors[color_name.to_sym] : self.body[:ct] = @mired_colors[color_name.to_sym]
58
- self.on
59
56
  end
60
57
 
61
58
  def saturation(depth)
62
59
  self.body.delete(:scene)
63
60
  self.body[:sat] = depth
64
- self.on
65
61
  end
66
62
 
67
63
  def brightness(depth)
68
64
  self.body.delete(:scene)
69
65
  self.body[:bri] = depth
70
- self.on
71
66
  end
72
67
 
73
68
  def fade(in_seconds)
@@ -80,16 +75,12 @@ class Switch
80
75
  self.body.delete(:groups)
81
76
  self.body.delete(:scene)
82
77
  args.each { |l| self.lights_array.push @lights[l.to_s] if @lights.keys.include?(l.to_s) }
83
- self.switch_state = "off"
84
- self.on
85
78
  end
86
79
 
87
80
  def group(group_name)
88
81
  self.lights_array = []
89
82
  self.body.delete(:scene)
90
83
  self._group = @groups[group_name.to_s]
91
- self.switch_state = "off"
92
- self.on
93
84
  end
94
85
 
95
86
  def scene(scene_name)
@@ -97,8 +88,6 @@ class Switch
97
88
  self._group = 0
98
89
  self.body.delete(:groups)
99
90
  self.body[:scene] = scene_name.to_s
100
- self.switch_state = "off"
101
- self.on
102
91
  end
103
92
 
104
93
  def save_scene (scene_name)
@@ -217,17 +206,14 @@ class Switch
217
206
  # Switches can be dynamic
218
207
  def colorloop(state = :on)
219
208
  state == :on ? self.body[:effect] = "colorloop" : self.body[:effect] = "none"
220
- self.on
221
209
  end
222
210
 
223
211
  def alert(state = :on)
224
212
  state == :on ? self.body[:alert] = "select" : self.body[:alert] = "none"
225
- self.on
226
213
  end
227
214
 
228
215
  def long_alert(state = :on)
229
216
  state == :on ? self.body[:alert] = "lselect" : self.body[:alert] = "none"
230
- self.on
231
217
  end
232
218
 
233
219
  def random_colors(state = :start, range: 0..65500)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hue_switch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sarkonovich
@@ -80,25 +80,27 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.0'
83
- description:
83
+ description: A 'switch' controls Hue lights, groups, or scenes. Switches can be scheduled,
84
+ and given dynamic effects.
84
85
  email:
85
86
  - sarkonovich@ at gmail dot com
86
87
  executables: []
87
88
  extensions: []
88
89
  extra_rdoc_files: []
89
90
  files:
90
- - ".gitignore"
91
- - ".travis.yml"
92
91
  - Gemfile
92
+ - Gemfile.lock
93
93
  - README.md
94
94
  - Rakefile
95
95
  - bin/console
96
96
  - bin/setup
97
+ - hue_switch-0.1.0.gem
97
98
  - hue_switch.gemspec
98
99
  - lib/hue_switch.rb
99
100
  - lib/hue_switch/version.rb
100
- homepage: http://www.github.com/sarkonovich
101
- licenses: []
101
+ homepage: http://www.github.com/sarkonovich/Hue-Switch
102
+ licenses:
103
+ - MIT
102
104
  metadata: {}
103
105
  post_install_message:
104
106
  rdoc_options: []
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/.travis.yml DELETED
@@ -1,3 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.1