trmnl-api 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 168b5086d30774ef88cc9d12ae187ffa4da349bfe10456c64a5e2fe7e94372a3
4
- data.tar.gz: d7c785269f0ddf0238d399a352cef774c9081bb6706a238cf9ead6bcc413ff0e
3
+ metadata.gz: bcb09ea59c1cbe86f0258090074a66e73e085912a4aacd0439a5aa131d8688ad
4
+ data.tar.gz: e2bbe53703db7d2c1bdad4594d75217aee1e8680a68e6c15962c3cd2f04f5218
5
5
  SHA512:
6
- metadata.gz: 4b6cdd52fa7cc10214220a4906298a1d2243d1da94f8854d1dd1eb67cdcd70a761655a717630bb561151e84c01b8926e7b9fac65e1cd84c9fb7590cddc164f7e
7
- data.tar.gz: 732532ba60f51c994898d1a982f404ba0d38b419ccc2c6cc95b46548234c51e1b40eedeeda6b4047d81b46f03408b4fccaa8dc8bef3b85dbcef70c0a4a355576
6
+ metadata.gz: a59f41ff8b9ec8924c66e35b211dcf3d42aabb26425a3467e6f9c2d1afc6cbf463d0710d6a5e3ae9c13eaddcfa75014831e5217feaf14ab6ed2cb9cd7cdb4cc8
7
+ data.tar.gz: a12ef6cd9a48449b11dd00f718cf14f431f0e211080a04b763f3e0040ef54fc82ee2ccec30fd1d7a39383d82be94ba5566e4761b5fc8c3259a35751eb454edfd
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -2,8 +2,8 @@
2
2
  :toclevels: 5
3
3
  :figure-caption!:
4
4
 
5
- :trmnl_link: link:https://usetrmnl.com[TRMNL]
6
- :trmnl_api_link: link:https://usetrmnl.com/api-docs/index.html[TRMNL API]
5
+ :trmnl_link: link:https://trmnl.com[TRMNL]
6
+ :trmnl_api_link: link:https://trmnl.com/api-docs/index.html[TRMNL API]
7
7
  :dry_monads_link: link:https://dry-rb.org/gems/dry-monads[Dry Monads]
8
8
 
9
9
  = TRMNL API
@@ -113,7 +113,7 @@ client.current_screen token: "secret"
113
113
  # Success(
114
114
  # #<data TRMNL::API::Models::CurrentScreen
115
115
  # refresh_rate=1773,
116
- # image_url="https://usetrmnl.com/plugin-2025-04-10T11-34-38Z-380c77",
116
+ # image_url="https://trmnl.com/plugin-2025-04-10T11-34-38Z-380c77",
117
117
  # filename="plugin-2025-04-10T11-34-38Z-380c77"
118
118
  # >
119
119
  # )
@@ -132,6 +132,7 @@ client.display token: "secret"
132
132
  # #<struct TRMNL::API::Models::Display
133
133
  # filename="plugin-1745348489",
134
134
  # firmware_url="https://trmnl-fw.s3.us-east-2.amazonaws.com/FW1.4.8.bin",
135
+ # firmware_version="1.4.8",
135
136
  # image_url="https://trmnl.s3.us-east-2.amazonaws.com/plugin-1745348489",
136
137
  # image_url_timeout=0,
137
138
  # refresh_rate=1771,
@@ -302,11 +303,11 @@ Success(
302
303
 
303
304
  ==== Recipes
304
305
 
305
- Allows you to obtain information about link:https://usetrmnl.com/recipes[Recipes]. Example:
306
+ Allows you to obtain information about link:https://trmnl.com/recipes[Recipes]. Example:
306
307
 
307
308
  [source,ruby]
308
309
  ----
309
- client = TRMNL::API.new { |settings| settings.uri = "https://usetrmnl.com" }
310
+ client = TRMNL::API.new { |settings| settings.uri = "https://trmnl.com" }
310
311
 
311
312
  client.recipes # Answers first page.
312
313
  client.recipes page: 10 # Answers page ten.
@@ -376,7 +377,7 @@ client.recipes sort: "popularity" # Answers first page sorted by popularity.
376
377
  # )
377
378
  ----
378
379
 
379
- ⚠️ This _does not_ use the {trmnl_api_link} like every other endpoint documented here. Instead, you must customize the settings URI to point to the root of the TRMNL application (i.e. `https://usetrmnl.com`) instead of using the default API endpoint.
380
+ ⚠️ This _does not_ use the {trmnl_api_link} like every other endpoint documented here. Instead, you must customize the settings URI to point to the root of the TRMNL application (i.e. `https://trmnl.com`) instead of using the default API endpoint.
380
381
 
381
382
  You'll always get a `data` array which may or may not be filled and `meta` (metadata) for handling pagination information. You can also combine the `page`, `search`, and `page` parameters as you see fit.
382
383
 
@@ -393,7 +394,7 @@ client.setup id: "A1:B2:C3:D4:E5:F6"
393
394
  # #<data TRMNL::API::Models::Setup
394
395
  # api_key="secret",
395
396
  # friendly_id="F51FDE",
396
- # image_url="https://usetrmnl.com/images/setup/setup-logo.bmp",
397
+ # image_url="https://trmnl.com/images/setup/setup-logo.bmp",
397
398
  # message="Register at usetrmnl.com/signup with Device ID 'F51FDE'"
398
399
  # >
399
400
  # )
@@ -429,4 +430,4 @@ bin/rake
429
430
  == Credits
430
431
 
431
432
  * Built with link:https://alchemists.io/projects/gemsmith[Gemsmith].
432
- * Engineered by link:https://usetrmnl.com/developers[TRMNL].
433
+ * Engineered by link:https://trmnl.com/developers[TRMNL].
@@ -13,7 +13,7 @@ module TRMNL
13
13
  def call
14
14
  model[
15
15
  content_type: environment.fetch("TRMNL_API_CONTENT_TYPE", "application/json"),
16
- uri: environment.fetch("TRMNL_API_URI", "https://usetrmnl.com/api")
16
+ uri: environment.fetch("TRMNL_API_URI", "https://trmnl.com/api")
17
17
  ]
18
18
  end
19
19
 
@@ -9,6 +9,7 @@ module TRMNL
9
9
  Display = Dry::Schema.JSON do
10
10
  required(:filename).filled :string
11
11
  required(:firmware_url).filled :string
12
+ optional(:firmware_version).maybe :string
12
13
  required(:image_url).filled :string
13
14
  required(:refresh_rate).filled :integer
14
15
  required(:reset_firmware).filled :bool
@@ -7,6 +7,7 @@ module TRMNL
7
7
  Display = Struct.new(
8
8
  :filename,
9
9
  :firmware_url,
10
+ :firmware_version,
10
11
  :image_url,
11
12
  :image_url_timeout,
12
13
  :refresh_rate,
@@ -5,6 +5,8 @@ module TRMNL
5
5
  module Models
6
6
  # Models the payload of the API response.
7
7
  Recipe = ::Data.define :data, :meta do
8
+ def self.empty(meta: Recipes::Meta.new) = new(data: [], meta:)
9
+
8
10
  def self.for(**attributes)
9
11
  meta = attributes.slice :from,
10
12
  :to,
data/trmnl-api.gemspec CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "trmnl-api"
5
- spec.version = "0.10.0"
5
+ spec.version = "0.12.0"
6
6
  spec.authors = ["TRMNL"]
7
- spec.email = ["engineering@usetrmnl.com"]
7
+ spec.email = ["engineering@trmnl.com"]
8
8
  spec.homepage = "https://github.com/usetrmnl/trmnl-api"
9
9
  spec.summary = "A monadic TRMNL API client."
10
10
  spec.license = "MIT"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trmnl-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TRMNL
@@ -176,7 +176,7 @@ dependencies:
176
176
  - !ruby/object:Gem::Version
177
177
  version: '2.7'
178
178
  email:
179
- - engineering@usetrmnl.com
179
+ - engineering@trmnl.com
180
180
  executables: []
181
181
  extensions: []
182
182
  extra_rdoc_files:
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  - !ruby/object:Gem::Version
254
254
  version: '0'
255
255
  requirements: []
256
- rubygems_version: 4.0.4
256
+ rubygems_version: 4.0.7
257
257
  specification_version: 4
258
258
  summary: A monadic TRMNL API client.
259
259
  test_files: []
metadata.gz.sig CHANGED
Binary file