nlhue 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/nlhue/bridge.rb +25 -0
- data/lib/nlhue/version.rb +1 -1
- data/nlhue.gemspec +5 -2
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 06b6ea3762cfc73808dac91dd559a0b18d3d5179e4735b39b0158874c6e83506
|
4
|
+
data.tar.gz: 5a32343e8b0a7a22e123c09edaf88cbaee1705db462d96b22a02280e0e6a777d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a795cc4d87efb3df87b855e24fd77bc77dfa1bc07f25ed1464b728a738d475bd2c627a2eb32b22f6886c43a72e043102b32ae2a0155aca2e8632c37ae8630faa
|
7
|
+
data.tar.gz: f98467b14dc7849c29bdaf93a67701219cbe2eb153dbde915a74869162c80db06624dcca7c1017394875d0a496594b819514f66a23ed70341a6d053104b4978e
|
data/lib/nlhue/bridge.rb
CHANGED
@@ -5,6 +5,7 @@ require 'eventmachine'
|
|
5
5
|
require 'em/protocols/httpclient'
|
6
6
|
require 'rexml/document'
|
7
7
|
require 'json'
|
8
|
+
require 'cgi/util'
|
8
9
|
|
9
10
|
require_relative 'request_queue'
|
10
11
|
|
@@ -554,6 +555,30 @@ module NLHue
|
|
554
555
|
end
|
555
556
|
end
|
556
557
|
|
558
|
+
# Deletes the given NLHue::Scene on this bridge. Calls the
|
559
|
+
# given block with true and a message on success, or false and
|
560
|
+
# an error on failure. Bridge notification callbacks will be
|
561
|
+
# called after the result is yielded.
|
562
|
+
def delete_scene scene, &block
|
563
|
+
raise "No scene was given to delete" if scene.nil?
|
564
|
+
raise "Scene must be a NLHue::Scene object" unless scene.is_a?(Scene)
|
565
|
+
raise "Scene is not from this bridge" unless scene.bridge == self
|
566
|
+
|
567
|
+
delete_api "/scenes/#{CGI.escape(scene.id)}", :lights do |response|
|
568
|
+
status, result = check_json response
|
569
|
+
|
570
|
+
if status
|
571
|
+
@scenes.delete scene.id
|
572
|
+
end
|
573
|
+
|
574
|
+
yield status, result if block_given?
|
575
|
+
|
576
|
+
if status
|
577
|
+
Bridge.notify_bridge_callbacks self, true
|
578
|
+
end
|
579
|
+
end
|
580
|
+
end
|
581
|
+
|
557
582
|
# Deletes the given NLHue::Group on this bridge. Raises an
|
558
583
|
# exception if the group is group 0. Calls the given block
|
559
584
|
# with true and a message on success, or false and an error on
|
data/lib/nlhue/version.rb
CHANGED
data/nlhue.gemspec
CHANGED
@@ -18,11 +18,14 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1
|
22
|
-
spec.add_development_dependency "rake", "~>
|
21
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
22
|
+
spec.add_development_dependency "rake", "~> 13.0.1"
|
23
23
|
spec.add_development_dependency 'pry'
|
24
24
|
spec.add_development_dependency 'pry-byebug'
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'eventmachine', '~> 1.0'
|
27
|
+
|
28
|
+
# TODO: Update to easy_upnp; UPnP homepage is gone and the gem hasn't been
|
29
|
+
# updated since 2009
|
27
30
|
spec.add_runtime_dependency 'UPnP', '~> 1.2'
|
28
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nlhue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bourgeous
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
20
|
type: :development
|
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: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 13.0.1
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 13.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
|
-
|
143
|
-
rubygems_version: 2.5.1
|
142
|
+
rubygems_version: 3.1.4
|
144
143
|
signing_key:
|
145
144
|
specification_version: 4
|
146
145
|
summary: An EventMachine-based library for interfacing with the Philips Hue lighting
|