timex_datalink_caldav 1.1.1 → 1.1.3

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: 5f4612f1904efd157ba195ed9b4b1db17877025eaa38801a8c00b02e2bd302d5
4
- data.tar.gz: bb734ba73ba8ebde1ef50fda7c85a25e6be05bbaa59b7273bbbabe7bca172b9c
3
+ metadata.gz: 5d5a3f969562134331aad6dca68c643933c28fb0ff54b69b311d3a6869ffafda
4
+ data.tar.gz: 20540f73bc0cc75843b1a5a7b4dd677dcd5e90597b8bdf4d570faa6b2cc46dc5
5
5
  SHA512:
6
- metadata.gz: 0cedac907434c2f7dc0c4f28cefc85d1c09b8b1186dc671d8fca6a0365f44c9fd7afd42967b9bc48314206d7caf47ac0f0de476204ade0df3e9a2e46bc23dc98
7
- data.tar.gz: 4e8f924a23cd5fe3401f70ae1d7a28070070a412de12ba6d1848818661b2ee616069feba1e993b47454874dc1ff1d3ba1261a09921ecca413877d3e32a2671e7
6
+ metadata.gz: 146d615f4942b1bba8aabe4892c8764c78215e82a89006ae6ffe093f8d3d0622c8f1f2ec2e86344989374e9d8596dd7407b8ea5eece171f9a023ff2d5b48fc38
7
+ data.tar.gz: 64f141143666c103795713065ce8b663805474c5af44cdccc14bfffffd8b6e3619628ca5dc541e4061805e5646659d22078553a7fc79f5af62538f67237ef7cc
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.12"
11
11
 
12
- gem "timex_datalink_client", "~> 0.11.0"
12
+ gem "timex_datalink_client", "~> 0.12.1"
13
13
 
14
14
  gem "calendav", "~> 0.4.0"
15
15
 
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- timex_datalink_caldav (1.0.0)
4
+ timex_datalink_caldav (1.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activemodel (7.0.4.3)
10
- activesupport (= 7.0.4.3)
11
- activesupport (7.0.4.3)
9
+ activemodel (7.0.6)
10
+ activesupport (= 7.0.6)
11
+ activesupport (7.0.6)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
@@ -39,7 +39,7 @@ GEM
39
39
  domain_name (~> 0.5)
40
40
  http-form_data (2.3.0)
41
41
  humanize (2.5.1)
42
- i18n (1.13.0)
42
+ i18n (1.14.1)
43
43
  concurrent-ruby (~> 1.0)
44
44
  icalendar (2.8.0)
45
45
  ice_cube (~> 0.16)
@@ -51,11 +51,11 @@ GEM
51
51
  ffi-compiler (~> 1.0)
52
52
  rake (~> 13.0)
53
53
  mdb (0.5.0)
54
- minitest (5.18.0)
55
- nokogiri (1.14.4-arm64-darwin)
54
+ minitest (5.18.1)
55
+ nokogiri (1.15.3-arm64-darwin)
56
56
  racc (~> 1.4)
57
- public_suffix (5.0.1)
58
- racc (1.6.2)
57
+ public_suffix (5.0.3)
58
+ racc (1.7.1)
59
59
  rake (13.0.6)
60
60
  rspec (3.12.0)
61
61
  rspec-core (~> 3.12.0)
@@ -69,12 +69,12 @@ GEM
69
69
  rspec-mocks (3.12.5)
70
70
  diff-lcs (>= 1.2.0, < 2.0)
71
71
  rspec-support (~> 3.12.0)
72
- rspec-support (3.12.0)
72
+ rspec-support (3.12.1)
73
73
  ruby-progressbar (1.13.0)
74
74
  rubyserial (0.6.0)
75
75
  ffi (~> 1.9, >= 1.9.3)
76
76
  text (1.3.1)
77
- timex_datalink_client (0.11.0)
77
+ timex_datalink_client (0.12.1)
78
78
  activemodel (~> 7.0.4)
79
79
  crc (~> 0.4.2)
80
80
  mdb (~> 0.5.0)
@@ -101,7 +101,7 @@ DEPENDENCIES
101
101
  ruby-progressbar (~> 1.13)
102
102
  text (~> 1.3)
103
103
  timex_datalink_caldav!
104
- timex_datalink_client (~> 0.11.0)
104
+ timex_datalink_client (~> 0.12.1)
105
105
  tzinfo (~> 2.0)
106
106
  yaml (~> 0.2.1)
107
107
 
data/README.md CHANGED
@@ -72,7 +72,7 @@ endpoints:
72
72
 
73
73
  The device is a serial device that flashes an led when it receives data. On Linux, this is usually `/dev/tty*`. On macOS, this is usually `$(ls /dev/tty.usbmodem* | head -n 1)`. On Windows, this is usually `COM1`.
74
74
 
75
- If you want to use this, I highly recommend pairing it with the Raspberry Pi Pico and [this project](https://github.com/famiclone6502/DIY_Datalink_Adapter). It is the cheapest and easiest way to get a serial device that works with the Timex Datalink watch.
75
+ If you want to use this, I highly recommend pairing it with the Raspberry Pi Pico and [this project](https://github.com/famiclone6502/DIY_Datalink_Adapter) or [this one](https://github.com/synthead/timex-datalink-arduino). It is the cheapest and easiest way to get a serial device that works with the Timex Datalink watch.
76
76
 
77
77
  ## Notes
78
78
 
@@ -20,7 +20,9 @@ module TimexDatalinkCaldav
20
20
  when 1 then TimexDatalinkClient::Protocol1
21
21
  when 3 then TimexDatalinkClient::Protocol3
22
22
  when 4 then TimexDatalinkClient::Protocol4
23
+ when 6 then TimexDatalinkClient::Protocol6
23
24
  when 7 then TimexDatalinkClient::Protocol7
25
+ when 9 then TimexDatalinkClient::Protocol9
24
26
  else
25
27
  raise ArgumentError, "Invalid protocol version: #{@protocol_version}"
26
28
  end
@@ -126,7 +128,7 @@ module TimexDatalinkCaldav
126
128
  est_time = occurrence.start_time.in_time_zone(get_localzone)
127
129
  key = "#{est_time}_#{summary_words.join(' ')}"
128
130
  unless anniversary_map[key]
129
- puts "Adding anniversary event: #{summary_words.join(' ')} at date #{event.dtstart.to_s}"
131
+ puts "Adding anniversary event: #{summary_words.join(' ')} at date #{est_time}"
130
132
  event_phrase = phrase_builder.vocab_ids_for(*summary_words)
131
133
  anniversary = @protocol_class::Eeprom::Calendar::Event.new(
132
134
  time: Time.new(est_time.year, est_time.month, est_time.day, 9, 30, 0),
@@ -159,9 +161,9 @@ module TimexDatalinkCaldav
159
161
  est_time = occurrence.start_time.in_time_zone(get_localzone)
160
162
  key = "#{est_time}_#{summary_words}"
161
163
  unless anniversary_map[key]
162
- puts "Adding anniversary: #{summary_words.join(' ')} at date #{event.dtstart.to_s}"
164
+ puts "Adding anniversary: #{summary_words.join(' ')} at date #{est_time}"
163
165
  anniversary = @protocol_class::Eeprom::Anniversary.new(
164
- time: event.dtstart.to_time,
166
+ time: est_time,
165
167
  anniversary: summary_words.join(' ')
166
168
  )
167
169
  anniversaries << anniversary
@@ -176,7 +178,7 @@ module TimexDatalinkCaldav
176
178
  time1 = Time.now + 3
177
179
  time2 = time1.dup.utc
178
180
 
179
- if @protocol_version == 1
181
+ if @protocol_version == 1 or @protocol_version == 9
180
182
  time_model = @protocol_class::Time.new(
181
183
  zone: 1,
182
184
  time: time1,
@@ -212,15 +214,40 @@ module TimexDatalinkCaldav
212
214
  )
213
215
  time_name_model = nil # Not needed for protocol version 3 and 4
214
216
  utc_time_name_model = nil # Not needed for protocol version 3 and 4
215
-
217
+ elsif @protocol_version == 6
218
+ time_model = @protocol_class::Time.new(
219
+ zone: 1,
220
+ time: time1,
221
+ is_24h: false,
222
+ date_format: "%_m-%d-%y"
223
+ )
224
+ utc_time_model = @protocol_class::Time.new(
225
+ zone: 2,
226
+ flex_time: true,
227
+ flex_time_zone: true,
228
+ is_24h: true,
229
+ date_format: "%_m-%d-%y"
230
+ )
231
+ time_name_model = nil # Not needed for protocol version 6
232
+ utc_time_name_model = nil # Not needed for protocol version 6
216
233
  else
217
234
  time_model = nil
218
235
  utc_time_model = nil
219
236
  time_name_model = nil
220
237
  utc_time_name_model = nil
221
238
  end
222
-
223
- if @protocol_version == 7
239
+
240
+ if @protocol_version == 6 or @protocol_version == 9
241
+ models = [
242
+ @protocol_class::Sync.new,
243
+ @protocol_class::Start.new,
244
+ time_model,
245
+ time_name_model,
246
+ utc_time_model,
247
+ utc_time_name_model,
248
+ @protocol_class::End.new
249
+ ].compact
250
+ elsif @protocol_version == 7
224
251
  calendar = @protocol_class::Eeprom::Calendar.new(
225
252
  time: time1,
226
253
  events: appointments
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TimexDatalinkCaldav
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timex_datalink_caldav
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willy Hardy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-07-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Adds a CLI and a feature to pull your next day of calendar events into
14
14
  the Timex Datalink watch. Note: Hardcoded protocol1 and EST timezone. At the moment.'