renstar 0.1.1 → 0.1.2

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: 4646094a81dc4998ee000f134956818fac7b791ce68ec11654e81418ac43cc37
4
- data.tar.gz: adbc5a003a2111cc658ab34abc4a5abbe998c8b1a8b4899159326690cee56f79
3
+ metadata.gz: 055f5f7d489740202bb43ffd7c91da02a79d83dc11102068bfd39a89d3241fd4
4
+ data.tar.gz: 877706e9308701870991f47abbc773b0c70492b4635b4d310accc88fa043b0d9
5
5
  SHA512:
6
- metadata.gz: 3323a727b6bcaed8b2636e39c602f48774c67f87066d19237ac4e26802e3bebec89ab793c4405d371d1c27ce9654dff52c4cb6d1ae46b2e78ca93e91d6aab518
7
- data.tar.gz: 66976f17ccf6a9672579d08e33019866744f9bc7e9897b9815db6e5649fcb2f4985f807ad35a04cc8ad5e2c737828932a1c8f9c7a5bee5a63ef2ec3f80511315
6
+ metadata.gz: 482dce11029a7a92d7aae52d100244cf072a6475040a7902418c708bbe77ed87cb4de317841e3feb9a514609fe23573d81857b831dd9e752219b5136ae402462
7
+ data.tar.gz: 9a6af8c214bdb41963a109a4da8638ba246b7a5f890327e5de0e87f08562404c5e032d74e807a42bbfb19fe05552f9ab39597015d4737c5a4b8697546b6bb119
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- renstar (0.1.0)
4
+ renstar (0.1.1)
5
5
  json
6
6
  ssdp
7
7
 
data/bin/renstar.rb ADDED
@@ -0,0 +1,50 @@
1
+ require 'renstar'
2
+ require 'optparse'
3
+ require 'ostruct'
4
+
5
+ class RenstarOptions
6
+ DEFAULT_OPTIONS = { all: false }.freeze
7
+ USAGE = " Usage: renstar.rb command [value]"
8
+
9
+ def self.parse(args)
10
+
11
+ @options = OpenStruct.new(DEFAULT_OPTIONS)
12
+
13
+ options = OptionParser.new do |opts|
14
+ opts.banner = USAGE
15
+
16
+ opts.on '-d', '--discover', 'Discover all Renstar devices' do |d|
17
+ @options.discover = true
18
+ end
19
+
20
+ opts.on '-h', '--help', 'Display this screen' do |h|
21
+ @options.help = true
22
+ end
23
+ end
24
+
25
+ options.parse!(args)
26
+
27
+ puts options if @options && ARGV == []
28
+
29
+ if @options.discover
30
+ Renstar.discover.each do |device|
31
+ puts "#{device.name} #{device.ip}"
32
+ end
33
+ exit 0
34
+ end
35
+
36
+ if @options.help
37
+ puts opts
38
+ exit 0
39
+ end
40
+
41
+
42
+ end
43
+ end
44
+
45
+ @options = RenstarOptions.parse(ARGV)
46
+
47
+ thermo = Renstar::Thermostat.search.first
48
+
49
+
50
+ thermo.send(*ARGV)
@@ -48,7 +48,7 @@ module Renstar
48
48
  def heat(heattemp = nil)
49
49
  update
50
50
  if heattemp
51
- cooltemp = heattemp + 1.0
51
+ cooltemp = heattemp.to_i + 1
52
52
  else
53
53
  cooltemp = @cached_info.cooltemp
54
54
  heattemp = @cached_info.heattemp
@@ -61,7 +61,7 @@ module Renstar
61
61
  def cool(cooltemp = nil)
62
62
  update
63
63
  if cooltemp
64
- heattemp = cooltemp - 1.0
64
+ heattemp = cooltemp.to_i - 1
65
65
  # heattemp = cooltemp - @cached_info.setpointdelta
66
66
  else
67
67
  cooltemp = @cached_info.cooltemp
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Renstar
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renstar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Rodrigues
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-30 00:00:00.000000000 Z
11
+ date: 2021-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -52,6 +52,7 @@ files:
52
52
  - README.md
53
53
  - Rakefile
54
54
  - bin/console
55
+ - bin/renstar.rb
55
56
  - bin/setup
56
57
  - lib/renstar.rb
57
58
  - lib/renstar/api_client.rb