capistrano-hue 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33982e90fb976ee6a62f3ea08073be1643cd0601
4
- data.tar.gz: 48c2b2120edb3407704a0ae0b5591153468a34e9
3
+ metadata.gz: 87321f0c8b0295642c3f0b5146089a905fce0441
4
+ data.tar.gz: 738d7ead31452eff7283cc3d01fff6ce2337c2db
5
5
  SHA512:
6
- metadata.gz: 5f69cf08eeb8b17acf0b56ed71a63f6ad3b048dd0d95a9fca0417d01222e138198ab56a9de871f5bbd91887fcc494ad6bb230cdf1642f1ebda9104de15b8df5f
7
- data.tar.gz: 540a82d0c6672d45a18b5b325cf2ddf82c328c42eebda964afa297d265ecc6c3af7960427bf9bf4e78cbab53dcc130d79131befa5cb24682300cc9fe3c1bc2d0
6
+ metadata.gz: 4c9f4f25c9786982e1bb07345bcd5b829c0a97fe1044728dc2aa26fb301ec132748b4cf67adef66bd60654a5e6ad91e555c1bb450b80fef5aa4d78646fd70aa9
7
+ data.tar.gz: 92517658ebabf1787420b6a599cc45b8e10e5ede840e50bf2a2d6f8666302addb80e8785b1ea5a9c40d90d8e28c7753d34d95ac2339c0247b426db5a18ed299f
data/README.md CHANGED
@@ -25,6 +25,12 @@ Add this line to your `Capfile`
25
25
 
26
26
  require 'capistrano/hue'
27
27
 
28
+ ## Preperation
29
+
30
+ * Check out the [Getting Started Guide](http://www.developers.meethue.com/documentation/getting-started) to set up an API user on you
31
+ Hue Bridge.
32
+ * On OSX need to install `pidof`
33
+
28
34
  ## Configuration
29
35
 
30
36
  ```
@@ -34,9 +40,12 @@ set :hue_enabled, true
34
40
  set :hue_bridge_ip, '10.100.198.4'
35
41
  set :hue_user_id, '871baa6b48b3a42af620f2509a1f'
36
42
  set :hue_light_bulp_id, 1
43
+ set :hue_color, { hue: 1, sat: 1, bri: 1 }
37
44
  set :hue_process_name, 'capistrano-hue'
38
45
  ```
39
46
 
47
+ You can test your configuration by running `cap <env> hue:start` to start the sequence and `cap <env> hue:stop` to stop the sequence.
48
+
40
49
  ## Development
41
50
 
42
51
  After checking out the repo, run `bin/setup` to install dependencies.
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "hue_bridge", "~> 0.1.1"
22
+ spec.add_dependency "hue_bridge", "~> 0.1.3"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.12"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
@@ -13,17 +13,23 @@ module Capistrano
13
13
  end
14
14
 
15
15
  bulp_opts = options.slice(:hue_bridge_ip, :user_id, :light_bulp_id)
16
+ color_opts = options.fetch(:color, false)
16
17
  light = HueBridge::LightBulp.new(bulp_opts)
18
+
17
19
  pid = Process.fork do
18
20
  $PROGRAM_NAME = options[:process_name]
19
21
 
22
+ light.store_state
23
+ light.on
24
+ light.set_color(color_opts) if color_opts && color_opts.any?
25
+
20
26
  begin
21
27
  while true do
22
- light.toggle
23
- sleep(2)
28
+ light.alert
29
+ sleep(15)
24
30
  end
25
31
  ensure
26
- light.off
32
+ light.restore_state
27
33
  end
28
34
  end
29
35
  $stdout.puts "Started capistrano-hue process with PID=#{pid}"
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Hue
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ namespace :load do
5
5
  set :hue_enabled, false
6
6
  set :hue_bridge_ip, nil
7
7
  set :hue_user_id, nil
8
+ set :hue_color, {}
8
9
  set :hue_light_bulp_id, 1
9
10
  set :hue_process_name, 'capistrano-hue'
10
11
  end
@@ -19,6 +20,7 @@ namespace :hue do
19
20
  hue_bridge_ip: fetch(:hue_bridge_ip),
20
21
  user_id: fetch(:hue_user_id),
21
22
  light_bulp_id: fetch(:hue_light_bulp_id),
23
+ color: fetch(:hue_color),
22
24
  process_name: fetch(:hue_process_name)
23
25
  }
24
26
  Capistrano::Hue::Sequence.start(options)
@@ -39,4 +41,5 @@ end
39
41
  namespace :deploy do
40
42
  before :starting, 'hue:start'
41
43
  after :finishing, 'hue:stop'
44
+ after :failed, 'hue:stop'
42
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-hue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristopher Bredemeier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hue_bridge
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.1
19
+ version: 0.1.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.1
26
+ version: 0.1.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -94,9 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.4.8
97
+ rubygems_version: 2.5.1
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Capistrano tasks for using Philips Hue lights as deployment indicator.
101
101
  test_files: []
102
- has_rdoc: