fitbit_api 1.0.1 → 1.1.0

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: 1330316b8f0703f202ab1d680fe07e2eb276c5bddf3d3f5288b4a704b10aa2c5
4
- data.tar.gz: 303cc5c8797d6943c02a81a1eed2bc83acc4a3785823bdb4a5ef065951d983b3
3
+ metadata.gz: e098773d09205d1ea4a0232df914bec3fe7032ffd81339b8551294c3c5495059
4
+ data.tar.gz: d8fb56568661230c2bd6893b41324b24b41439cdcb9b8d93fa7134f7e54c0f38
5
5
  SHA512:
6
- metadata.gz: 7191b08e34492465e193bf59e147e7de3602e0dfd81633f4b365f87661bb0fb5cab924a542f40bf12d72f31ed03d4690918bef08fb034ae5f3acd32341827b43
7
- data.tar.gz: 9dca14668d515aa6094c1d28c5aa5b01b16e31f9ddbe54b88921dfc0d306ffe94f17413209ed89ce1806fcb8719f18d05fde38266be23cac12fc22b27ca69cb8
6
+ metadata.gz: 2ec11c165d17e279cb7621f6b22fd1cb8ae172d7f8af4d57b38899c37e0e1b2f7fb605c9c27f200278086df331651f635ab79e20c7a61ed5a9359a54e25cb400
7
+ data.tar.gz: 8270fc77279f80209d47bb7769cbc5640379d2908c36f265999da820a7189c57c9a01efe4f0452d7e414464b8fade3a6fecd7972361ae28b55d17effa6771457
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 1.1.0
2
+ -----
3
+ - Add Irregular Rhythm Notifications (IRN) endpoint support
4
+
1
5
  1.0.1
2
6
  -----
3
7
  - Remove unused values from default params for the following:
data/README.md CHANGED
@@ -100,7 +100,7 @@ When initializing a `FitbitAPI::Client` instance, you're given access to a handf
100
100
  | `api_version` | API version to be used when making requests | `"1"` |
101
101
  | `unit_system` | The measurement unit system to use for response values | `"en_US"` |
102
102
  | `locale` | The locale to use for response values | `"en_US"` |
103
- | `scope` | A list of permissions being requested (array or space-delimited string) | `%w[activity nutrition profile settings sleep social weight heartrate respiratory_rate oxygen_saturation cardio_fitness temperature electrocardiogram]` |
103
+ | `scope` | A list of permissions being requested (array or space-delimited string) | `%w[activity nutrition profile settings sleep social weight heartrate respiratory_rate oxygen_saturation cardio_fitness temperature electrocardiogram irregular_rhythm_notifications]` |
104
104
  | `snake_case_keys` | Transform response payload's keys to snake case format | `false` |
105
105
  | `symbolize_keys` | Transform response payload's keys to symbols | `false` |
106
106
  | `auto_refresh_token` | Automatically refreshes the access token once expired | `true` |
@@ -19,7 +19,7 @@ module FitbitAPI
19
19
  define_setting :locale, 'en_US'
20
20
  define_setting :scope, %w[activity nutrition profile settings sleep social weight
21
21
  heartrate respiratory_rate oxygen_saturation cardio_fitness
22
- temperature electrocardiogram]
22
+ temperature electrocardiogram irregular_rhythm_notifications]
23
23
 
24
24
  define_setting :api_version, '1'
25
25
 
@@ -8,6 +8,7 @@ require 'fitbit_api/cardio_score'
8
8
  require 'fitbit_api/electrocardiogram'
9
9
  require 'fitbit_api/heart_rate'
10
10
  require 'fitbit_api/heart_rate_variability'
11
+ require 'fitbit_api/irregular_rhythm_notifications'
11
12
  require 'fitbit_api/goals'
12
13
  require 'fitbit_api/alarms'
13
14
  require 'fitbit_api/body'
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FitbitAPI
4
+ class Client
5
+ # Retrieves a paginated list of Irregular Rhythm Notifications (IRN) alerts,
6
+ # as well as all of the alert tachograms.
7
+ #
8
+ # irn_alerts_list(before_date: Date.parse('2021-05-24'), limit: 5)
9
+ #
10
+ # @param params [Hash] The request parameters
11
+ #
12
+ # @option params :before_date [Date] Specify when filtering entries that occured before the given date
13
+ # @option params :after_date [Date] Specify when filtering entries that occured after the given date
14
+ # @option params :sort [String] The Sort order of entries by date (asc or desc)
15
+ # @option params :offset [Integer] The offset number of entries. Must always be 0
16
+ # @option params :limit [Integer] The max of the number of entries returned (max: 10)
17
+
18
+ def irn_alerts_list(params = {})
19
+ default_params = { before_date: Date.today, sort: 'desc', limit: 10, offset: 0 }
20
+ get("user/#{user_id}/irn/alerts/list.json", default_params.merge(params))
21
+ end
22
+
23
+ # Retrieves the user state for Irregular Rhythm Notifications (IRN).
24
+
25
+ def irn_profile
26
+ get("user/#{user_id}/irn/profile.json")
27
+ end
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FitbitAPI
4
- VERSION = '1.0.1'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitbit_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-07 00:00:00.000000000 Z
11
+ date: 2024-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -108,6 +108,7 @@ files:
108
108
  - lib/fitbit_api/helpers/configuration.rb
109
109
  - lib/fitbit_api/helpers/exceptions.rb
110
110
  - lib/fitbit_api/helpers/utils.rb
111
+ - lib/fitbit_api/irregular_rhythm_notifications.rb
111
112
  - lib/fitbit_api/meals.rb
112
113
  - lib/fitbit_api/oxygen_saturation.rb
113
114
  - lib/fitbit_api/sleep.rb
@@ -121,8 +122,8 @@ licenses:
121
122
  - MIT
122
123
  metadata:
123
124
  source_code_uri: https://github.com/zokioki/fitbit_api
124
- changelog_uri: https://github.com/zokioki/fitbit_api/blob/v1.0.1/CHANGELOG.md
125
- documentation_uri: https://www.rubydoc.info/gems/fitbit_api/1.0.1
125
+ changelog_uri: https://github.com/zokioki/fitbit_api/blob/v1.1.0/CHANGELOG.md
126
+ documentation_uri: https://www.rubydoc.info/gems/fitbit_api/1.1.0
126
127
  rubygems_mfa_required: 'true'
127
128
  post_install_message:
128
129
  rdoc_options: []