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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 500a673faf1257f9237ad66eb5c47cc852e3304f0aa458b137368afd720a9354
4
- data.tar.gz: e9bd47febd94eb07be90b4914ad8cf5c2ad9b252751e98ab1fa989a64f77984b
3
+ metadata.gz: df08d345a1f2f4591c8b6b7584434d3a8db369297bc0b5ede94908a66238a300
4
+ data.tar.gz: 5e894436da15580b8e6e93a8065442fe3c555b269205453957e3ae0fa336b0c2
5
5
  SHA512:
6
- metadata.gz: 39f34213c145f83d0dc2db551514599d5b66d0d1db5ea5275e64440b5273e7620c7de8d0d31fa67290a1621cf86c1d976e92ba710145629ad673d6004abaf9d2
7
- data.tar.gz: e7b88500d35fe156b9c1fc22e9b9c19ce3cd58cf7b2a7ffdf8fed9a3200f149a306440492768a20f33d5a26755bbdd190c812e64608ff587d882634a2ec7592b
6
+ metadata.gz: 6af5bd3f911e5a204d9801a31240ee2d71367e025f9ae9989ff61917dee31168c14059cf3eb59578eb9f8a35306d918e72659d8a291134face9b4666dcf43e19
7
+ data.tar.gz: d3ce9b5f7ff669835356bf6dca49702200d34ec7f50e8023aee2ba411e2d1bd5aaf34a563a518ee3e7c3b6d7291f1657248220ee526c9b46d79909b82162d949
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- light_me_up (0.2.0)
4
+ light_me_up (0.2.3)
5
5
  optimist (~> 3.0)
6
6
 
7
7
  GEM
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.reverse_merge!(
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LightMeUp
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.4"
5
5
  end
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.0
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-14 00:00:00.000000000 Z
11
+ date: 2022-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optimist