timex_datalink_caldav 1.1.2 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +12 -12
- data/README.md +5 -2
- data/lib/timex_datalink_caldav/client.rb +34 -4
- data/lib/timex_datalink_caldav/version.rb +1 -1
- data/lib/timex_datalink_caldav.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: 2d059c63a228fea3df7cf1c83fec9f75814d715943781dd797e50bfc6363f3e8
|
4
|
+
data.tar.gz: 7c5dd84c49aa45a0464a5dc67eedc09d19fecb85140a20d0fb25fc5e4cbdea9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f272dd7cb55977b653186aa46c0e817af6a9d339a300e6e5ef022c28dac9b97ff299fbe9fd3a3a51599eca8e37fbfb4d81b1e9cc453dda5e58200d37d9585b9
|
7
|
+
data.tar.gz: 0b5a4ceb39815c7aec63cc45a344e351471f405e71c1128300cea9c7910caa67591380ff1fd77ed4c8727228d9007a522d339eb153e0f0e05529151ff055b250
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
timex_datalink_caldav (1.
|
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.
|
10
|
-
activesupport (= 7.0.
|
11
|
-
activesupport (7.0.
|
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.
|
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.
|
55
|
-
nokogiri (1.
|
54
|
+
minitest (5.18.1)
|
55
|
+
nokogiri (1.15.3-arm64-darwin)
|
56
56
|
racc (~> 1.4)
|
57
|
-
public_suffix (5.0.
|
58
|
-
racc (1.
|
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.
|
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.
|
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.
|
104
|
+
timex_datalink_client (~> 0.12.1)
|
105
105
|
tzinfo (~> 2.0)
|
106
106
|
yaml (~> 0.2.1)
|
107
107
|
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# TimexDatalinkCaldav
|
2
2
|
|
3
|
+
![signal-2023-06-22-120357](https://github.com/wjhrdy/timex-datalink-caldav/assets/1795778/85ad006c-6a61-4178-ad03-9c8674172619)
|
4
|
+
|
5
|
+
|
3
6
|
TimexDatalinkCaldav is a simple Ruby gem designed to sync events from a CalDAV server or an ical formatted ics file to a Timex Datalink watch. It can also be used as a standalone command-line interface (CLI) tool.
|
4
7
|
|
5
8
|
## Pre-requisites
|
@@ -72,7 +75,7 @@ endpoints:
|
|
72
75
|
|
73
76
|
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
77
|
|
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.
|
78
|
+
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
79
|
|
77
80
|
## Notes
|
78
81
|
|
@@ -82,4 +85,4 @@ If you want to use this, I highly recommend pairing it with the Raspberry Pi Pic
|
|
82
85
|
|
83
86
|
## Thanks
|
84
87
|
|
85
|
-
- This project would not exist without the hard work of the people who reverse engineered the Timex Datalink protocol. I would like to thank them for their hard work. Mainly this gem https://github.com/synthead/timex_datalink_client
|
88
|
+
- This project would not exist without the hard work of the people who reverse engineered the Timex Datalink protocol. I would like to thank them for their hard work. Mainly this gem https://github.com/synthead/timex_datalink_client
|
@@ -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
|
@@ -78,6 +80,8 @@ module TimexDatalinkCaldav
|
|
78
80
|
else
|
79
81
|
add_appointment_event(appointment_map, appointments, phrase_builder, summary_words, occurrences)
|
80
82
|
end
|
83
|
+
elsif @protocol_version == 9 or @protocol_version == 6
|
84
|
+
print "Protocol version #{@protocol_version} doesn't support events, skipping event: #{summary_words.join(' ')}\n"
|
81
85
|
else
|
82
86
|
if all_day_event?(event)
|
83
87
|
add_anniversary(event, anniversary_map, anniversaries, summary_words, occurrences)
|
@@ -176,7 +180,7 @@ module TimexDatalinkCaldav
|
|
176
180
|
time1 = Time.now + 3
|
177
181
|
time2 = time1.dup.utc
|
178
182
|
|
179
|
-
if @protocol_version == 1
|
183
|
+
if @protocol_version == 1 or @protocol_version == 9
|
180
184
|
time_model = @protocol_class::Time.new(
|
181
185
|
zone: 1,
|
182
186
|
time: time1,
|
@@ -212,15 +216,41 @@ module TimexDatalinkCaldav
|
|
212
216
|
)
|
213
217
|
time_name_model = nil # Not needed for protocol version 3 and 4
|
214
218
|
utc_time_name_model = nil # Not needed for protocol version 3 and 4
|
215
|
-
|
219
|
+
elsif @protocol_version == 6
|
220
|
+
time_model = @protocol_class::Time.new(
|
221
|
+
zone: 1,
|
222
|
+
time: time1,
|
223
|
+
is_24h: false,
|
224
|
+
date_format: "%_m-%d-%y"
|
225
|
+
)
|
226
|
+
utc_time_model = @protocol_class::Time.new(
|
227
|
+
zone: 2,
|
228
|
+
time: time2,
|
229
|
+
flex_time: true,
|
230
|
+
flex_time_zone: true,
|
231
|
+
is_24h: true,
|
232
|
+
date_format: "%_m-%d-%y"
|
233
|
+
)
|
234
|
+
time_name_model = nil # Not needed for protocol version 6
|
235
|
+
utc_time_name_model = nil # Not needed for protocol version 6
|
216
236
|
else
|
217
237
|
time_model = nil
|
218
238
|
utc_time_model = nil
|
219
239
|
time_name_model = nil
|
220
240
|
utc_time_name_model = nil
|
221
241
|
end
|
222
|
-
|
223
|
-
if @protocol_version ==
|
242
|
+
|
243
|
+
if @protocol_version == 6 or @protocol_version == 9
|
244
|
+
models = [
|
245
|
+
@protocol_class::Sync.new,
|
246
|
+
@protocol_class::Start.new,
|
247
|
+
time_model,
|
248
|
+
time_name_model,
|
249
|
+
utc_time_model,
|
250
|
+
utc_time_name_model,
|
251
|
+
@protocol_class::End.new
|
252
|
+
].compact
|
253
|
+
elsif @protocol_version == 7
|
224
254
|
calendar = @protocol_class::Eeprom::Calendar.new(
|
225
255
|
time: time1,
|
226
256
|
events: appointments
|
@@ -20,7 +20,7 @@ module TimexDatalinkCaldav
|
|
20
20
|
all_anniversaries.concat(anniversaries) if anniversaries.any?
|
21
21
|
end
|
22
22
|
|
23
|
-
if all_appointments.any? || all_anniversaries.any?
|
23
|
+
if all_appointments.any? || all_anniversaries.any? || @options[:api] == "6" or @options[:api] == "9"
|
24
24
|
client = TimexDatalinkCaldav::Client.new(
|
25
25
|
@options[:endpoints][0][:user],
|
26
26
|
@options[:endpoints][0][:password],
|
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.
|
4
|
+
version: 1.1.4
|
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-
|
11
|
+
date: 2023-07-14 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.'
|