light_me_up 0.2.0 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/light-me-up +3 -3
- data/lib/light_me_up/settings_update.rb +4 -4
- data/lib/light_me_up/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df08d345a1f2f4591c8b6b7584434d3a8db369297bc0b5ede94908a66238a300
|
4
|
+
data.tar.gz: 5e894436da15580b8e6e93a8065442fe3c555b269205453957e3ae0fa336b0c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6af5bd3f911e5a204d9801a31240ee2d71367e025f9ae9989ff61917dee31168c14059cf3eb59578eb9f8a35306d918e72659d8a291134face9b4666dcf43e19
|
7
|
+
data.tar.gz: d3ce9b5f7ff669835356bf6dca49702200d34ec7f50e8023aee2ba411e2d1bd5aaf34a563a518ee3e7c3b6d7291f1657248220ee526c9b46d79909b82162d949
|
data/Gemfile.lock
CHANGED
data/bin/light-me-up
CHANGED
@@ -30,10 +30,10 @@ end
|
|
30
30
|
options = options.select { |_k, v| v }
|
31
31
|
options[:on] = false if options.delete(:off)
|
32
32
|
if options.delete(:defaults)
|
33
|
-
options
|
33
|
+
options = {
|
34
34
|
brightness: ENV["ELGATO_DEFAULT_BRIGHTNESS"].to_i,
|
35
35
|
temperature: ENV["ELGATO_DEFAULT_TEMPERATURE"].to_i
|
36
|
-
)
|
36
|
+
}.merge(options)
|
37
37
|
end
|
38
38
|
|
39
39
|
api_client = LightMeUp::ApiClient.new(ip_address: options[:ip_address])
|
@@ -42,7 +42,7 @@ begin
|
|
42
42
|
LightMeUp::SettingsUpdate.new(api_client, options).perform
|
43
43
|
rescue LightMeUp::SettingsUpdate::ToggleIncompatible => e
|
44
44
|
Optimist.die :toggle, e.message
|
45
|
-
rescue LightMeUp::NoOptionsGiven
|
45
|
+
rescue LightMeUp::SettingsUpdate::NoOptionsGiven
|
46
46
|
Optimist.educate
|
47
47
|
rescue LightMeUp::Error => e
|
48
48
|
warn e.message
|
@@ -17,11 +17,11 @@ module LightMeUp
|
|
17
17
|
raise ToggleIncompatible, "is not compatible with setting other options" if settings_options.any?
|
18
18
|
|
19
19
|
api_client.toggle
|
20
|
+
elsif settings_options.any?
|
21
|
+
api_client.update(**settings_options)
|
22
|
+
else
|
23
|
+
raise NoOptionsGiven, "provide at least one option"
|
20
24
|
end
|
21
|
-
|
22
|
-
api_client.set(**settings_options) if settings_options.any?
|
23
|
-
|
24
|
-
raise NoOptionsGiven, "provide at least one option"
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
data/lib/light_me_up/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: light_me_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter McCracken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: optimist
|