htcc 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/htcc.gemspec +1 -1
  3. data/lib/htcc/thermostat.rb +48 -9
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d2ac4838a69bf4dcef314f14059014aa627f6429c0e44c19b9c0ea546e0dd7c
4
- data.tar.gz: 65c2a961af5a31027197d28a6b7b65a3f9ed5d15ab3951a6cbd51911f226b939
3
+ metadata.gz: 41cf4b7e6fb39144a8cdb77b69f5db8a1e13eef9d0260abe654336682e06a65b
4
+ data.tar.gz: 742de511fe3af1fb251c40022de0991559ce80f40abd30550ff850ef9c2cdb22
5
5
  SHA512:
6
- metadata.gz: 7a535e2721b5aa8cf986dca91d3e2f357dcc46e7803578c5fef580bef0f4f94b473b5d00eb12229fcbbe5b419058f6fb828c88c04434a2ce5168ac43ebebb08b
7
- data.tar.gz: e6b2d3659b08d587a807e5696819a2c92c7004ad8d99e0b6bce5d2f966a05411986bed45b83a599a451a41cd6557d6c496a821ab23aa8b031335f1f10809649f
6
+ metadata.gz: 0f08bee8865ffb4c81048e016e0e475556faec9565d6bf1996bf00b888b97f371881b80b91fd0dfa39db259a4d51aec8daedd17a95d786aa64c0cf08599338cf
7
+ data.tar.gz: 45d37ca81112ea7ac68784e25177e208505884c9a12e822187bc7d6f5cf044b937df42c23f603385ea89e72fd3e020466d39804251b99a9c64dc1f5d94de1397
data/htcc.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'htcc'
3
- s.version = '0.3.0'
3
+ s.version = '0.3.1'
4
4
  s.summary = "A Ruby client for the Honeywell Total Connect Comfort API"
5
5
  s.description = "This gem can be used to control Honeywell thermostats that use the Total Connect Comfort platform."
6
6
  s.author = 'Lee Folkman'
@@ -2,10 +2,36 @@
2
2
 
3
3
  module HTCC
4
4
  class Thermostat
5
- SYSTEM_MODES = %i[emergency_heat heat off cool auto]
6
- FAN_MODES = %i[auto on circulate schedule]
7
- HOLD_TYPES = %i[none temporary permanent]
8
- EQUIPMENT_OUTPUT_STATUS = %i[off heating cooling fan_running]
5
+ SYSTEM_MODES = %i[emergency_heat heat off cool auto].freeze
6
+ FAN_MODES = %i[auto on circulate schedule].freeze
7
+ HOLD_TYPES = %i[none temporary permanent].freeze
8
+ EQUIPMENT_OUTPUT_STATUS = %i[off heating cooling fan_running].freeze
9
+ HOLD_TIMES = [
10
+ '00:00', '00:15', '00:30', '00:45',
11
+ '01:00', '01:15', '01:30', '01:45',
12
+ '02:00', '02:15', '02:30', '02:45',
13
+ '03:00', '03:15', '03:30', '03:45',
14
+ '04:00', '04:15', '04:30', '04:45',
15
+ '05:00', '05:15', '05:30', '05:45',
16
+ '06:00', '06:15', '06:30', '06:45',
17
+ '07:00', '07:15', '07:30', '07:45',
18
+ '08:00', '08:15', '08:30', '08:45',
19
+ '09:00', '09:15', '09:30', '09:45',
20
+ '10:00', '10:15', '10:30', '10:45',
21
+ '11:00', '11:15', '11:30', '11:45',
22
+ '12:00', '12:15', '12:30', '12:45',
23
+ '13:00', '13:15', '13:30', '13:45',
24
+ '14:00', '14:15', '14:30', '14:45',
25
+ '15:00', '15:15', '15:30', '15:45',
26
+ '16:00', '16:15', '16:30', '16:45',
27
+ '17:00', '17:15', '17:30', '17:45',
28
+ '18:00', '18:15', '18:30', '18:45',
29
+ '19:00', '19:15', '19:30', '19:45',
30
+ '20:00', '20:15', '20:30', '20:45',
31
+ '21:00', '21:15', '21:30', '21:45',
32
+ '22:00', '22:15', '22:30', '22:45',
33
+ '23:00', '23:15', '23:30', '23:45'
34
+ ].freeze
9
35
 
10
36
  attr_reader :info
11
37
 
@@ -131,7 +157,7 @@ module HTCC
131
157
 
132
158
  def hold
133
159
  get_status
134
- HOLD_TYPES[@status['latestData']['uiData']['StatusHeat']] # Both status are the same
160
+ HOLD_TYPES[@status['latestData']['uiData']['StatusHeat']] # Both statuses return the same value
135
161
  end
136
162
 
137
163
  def hold=(mode)
@@ -141,6 +167,20 @@ module HTCC
141
167
  change_setting(hold: mode)
142
168
  end
143
169
 
170
+ def hold_until
171
+ get_status
172
+ HOLD_TIMES[@status['latestData']['uiData']['HeatNextPeriod']] # Both periods return the same value
173
+ end
174
+
175
+ def hold_until=(time)
176
+ unless HOLD_TIMES.index(time)
177
+ raise HoldError.new(
178
+ "Unknown hold time: #{time.inspect}. Valid times are from 00:00 - 23:45 in 15 minute intervals."
179
+ )
180
+ end
181
+ change_setting(hold_until: time, hold: :temporary)
182
+ end
183
+
144
184
  def output_status
145
185
  get_status
146
186
  status = @status['latestData']['uiData']['EquipmentOutputStatus']
@@ -227,8 +267,7 @@ module HTCC
227
267
  system_mode: nil,
228
268
  heat_setpoint: nil,
229
269
  cool_setpoint: nil,
230
- heat_next_period: nil,
231
- cool_next_period: nil,
270
+ hold_until: nil,
232
271
  hold: nil,
233
272
  fan_mode: nil
234
273
  )
@@ -237,8 +276,8 @@ module HTCC
237
276
  'SystemSwitch': SYSTEM_MODES.index(system_mode),
238
277
  'HeatSetpoint': heat_setpoint,
239
278
  'CoolSetpoint': cool_setpoint,
240
- 'HeatNextPeriod': heat_next_period, # 0 = hold until 00:00, ..., 92 = hold until 23:45
241
- 'CoolNextPeriod': cool_next_period, # 0 = hold until 00:00, ..., 92 = hold until 23:45
279
+ 'HeatNextPeriod': HOLD_TIMES.index(hold_until),
280
+ 'CoolNextPeriod': HOLD_TIMES.index(hold_until),
242
281
  'StatusHeat': HOLD_TYPES.index(hold),
243
282
  'StatusCool': HOLD_TYPES.index(hold),
244
283
  'FanMode': FAN_MODES.index(fan_mode)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htcc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Folkman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2021-03-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem can be used to control Honeywell thermostats that use the Total
14
14
  Connect Comfort platform.