trmnl-api 0.22.0 → 0.23.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: 8efedaa295b0c387a87ff3ae179bc8179e21485505de33474d1b5e00bb694e15
4
- data.tar.gz: ca6875d143b129e2b42114289a3be856e41b5581b4e7ba5286292e6829b3c940
3
+ metadata.gz: f0980ab987d84b0a2b433ba2e51c940debf05ab8300b68fdabb957bd5d193f8c
4
+ data.tar.gz: e879629070c4aa3790fee398e737c095818e47db0e182fe68dd19b96679ee731
5
5
  SHA512:
6
- metadata.gz: d2ba42f64f6e549c6852b5326d7ef0e1a1a8356baff3010fa88e2fe7469fcc82986b3b15ade6fe9734cc1d7df36474139b8c6345733eb8bf932e900ddd04f791
7
- data.tar.gz: 0d7e7e1ade6a86c1f689ac783ba5160dd87544306e295b9befe9150c86cb26d410f15e0efa64ee867be9e2a06ef06bd82c6ff19a6502a53709da4a2f863db570
6
+ metadata.gz: f68e6cbf30b644f3c931d184f709cdca9d412880bbd369fc21aabd407879c4e959f2d6067be5a6bba647bd6ef8970ec2dfab29bff49e07069a7e909dbd253cfc
7
+ data.tar.gz: 92f25649191286a0a4bc9b17a75cc69330f366daa4b67033335a50d0a95ed504823e6460f3a8dbc83781b5beead560b1343d1967332524cc832fa771aa0dfcfc
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -137,20 +137,21 @@ client = TRMNL::API.new
137
137
  client.display token: "secret"
138
138
 
139
139
  # Success(
140
- # #<struct TRMNL::API::Models::Display
141
- # filename="plugin-4c2660-1780411821",
142
- # firmware_url="https://trmnl-fw.s3.us-east-2.amazonaws.com/trmnl_og/FW1.8.5.bin",
143
- # firmware_version="1.8.5",
144
- # image_url="https://trmnl.s3.us-east-2.amazonaws.com/...",
145
- # image_url_timeout=0,
146
- # maximum_compatibility=false,
147
- # refresh_rate=1765,
148
- # reset_firmware=false,
149
- # special_function="none",
150
- # temperature_profile="default",
151
- # touchbar_mode="tap",
152
- # update_firmware=true
153
- # >
140
+ # #<data TRMNL::API::Models::Display
141
+ # filename="plugin-0ac339-1794250527",
142
+ # image_url="https://trmnl.s3.us-east-2.amazonaws.com/...",
143
+ # image_url_timeout=0,
144
+ # refresh_rate=1769,
145
+ # firmware_version="1.8.18",
146
+ # firmware_url="https://trmnl-fw.s3.us-east-2.amazonaws.com/trmnl_og/FW1.8.18.bin",
147
+ # update_firmware=true,
148
+ # reset_firmware=false,
149
+ # maximum_compatibility=false,
150
+ # temperature_profile="default",
151
+ # touchbar_mode="tap",
152
+ # action=nil,
153
+ # playlist_image_names=["plugin-0ac339", "plugin-f60d70", "plugin-499f35"]
154
+ # >
154
155
  # )
155
156
  ----
156
157
 
@@ -386,6 +387,7 @@ client.models
386
387
  # "gray-4",
387
388
  # "bw"
388
389
  # ],
390
+ # default_palette_name = "gray-16"
389
391
  # rotation = 0,
390
392
  # scale_factor = 1.8,
391
393
  # width = 1872
@@ -6,9 +6,6 @@ module TRMNL
6
6
  module API
7
7
  # Provides the primary client for making API requests.
8
8
  class Client
9
- include Dependencies[:settings]
10
- include Inspectable[:endpoints]
11
-
12
9
  ENDPOINTS = {
13
10
  categories: Endpoints::Category,
14
11
  current_screen: Endpoints::CurrentScreen,
@@ -23,6 +20,9 @@ module TRMNL
23
20
  setup: Endpoints::Setup
24
21
  }.freeze
25
22
 
23
+ include Dependencies[:settings]
24
+ include Inspectable[:endpoints]
25
+
26
26
  def initialize(requester: Requester, endpoints: ENDPOINTS, **)
27
27
  super(**)
28
28
 
@@ -9,6 +9,8 @@ module TRMNL
9
9
  module Firmware
10
10
  # Handles API request/response.
11
11
  class Latest
12
+ ASSET_URI = "https://trmnl-fw.s3.us-east-2.amazonaws.com/%<model_name>s/FW%<version>s.bin"
13
+
12
14
  include TRMNL::API::Dependencies[
13
15
  :requester,
14
16
  schema: "schemas.firmware.latest",
@@ -18,8 +20,6 @@ module TRMNL
18
20
  include Inspectable[schema: :type]
19
21
  include Pipeable
20
22
 
21
- ASSET_URI = "https://trmnl-fw.s3.us-east-2.amazonaws.com/%<model_name>s/FW%<version>s.bin"
22
-
23
23
  def initialize(asset_uri: ASSET_URI, **)
24
24
  @asset_uri = asset_uri
25
25
  super(**)
@@ -6,32 +6,34 @@ module TRMNL
6
6
  # Models the data of the API response.
7
7
  Display = Data.define(
8
8
  :filename,
9
- :firmware_url,
10
- :firmware_version,
11
9
  :image_url,
12
10
  :image_url_timeout,
13
- :maximum_compatibility,
14
11
  :refresh_rate,
12
+ :firmware_version,
13
+ :firmware_url,
14
+ :update_firmware,
15
15
  :reset_firmware,
16
- :special_function,
16
+ :maximum_compatibility,
17
17
  :temperature_profile,
18
18
  :touchbar_mode,
19
- :update_firmware
19
+ :action,
20
+ :playlist_image_names
20
21
  ) do
21
22
  def self.for(attributes) = new(**attributes)
22
23
 
23
24
  def initialize filename: nil,
24
- firmware_url: nil,
25
- firmware_version: nil,
26
25
  image_url: nil,
27
26
  image_url_timeout: 0,
28
- maximum_compatibility: false,
29
27
  refresh_rate: 300,
28
+ firmware_version: nil,
29
+ firmware_url: nil,
30
+ update_firmware: false,
30
31
  reset_firmware: false,
31
- special_function: "none",
32
+ maximum_compatibility: false,
32
33
  temperature_profile: "default",
33
34
  touchbar_mode: "tap",
34
- update_firmware: false
35
+ action: nil,
36
+ playlist_image_names: nil
35
37
  super
36
38
  end
37
39
 
@@ -21,9 +21,17 @@ module TRMNL
21
21
  :offset_x,
22
22
  :offset_y,
23
23
  :palette_names,
24
+ :default_palette_name,
24
25
  :css
25
26
  ) do
26
- def self.for(attributes) = new(**attributes.transform_keys!(palette_ids: :palette_names))
27
+ def self.for attributes
28
+ new(
29
+ **attributes.transform_keys!(
30
+ palette_ids: :palette_names,
31
+ default_palette_id: :default_palette_name
32
+ )
33
+ )
34
+ end
27
35
 
28
36
  def initialize(**)
29
37
  super
@@ -8,13 +8,18 @@ module TRMNL
8
8
  # Validates API response.
9
9
  Display = Dry::Schema.JSON do
10
10
  required(:filename).filled :string
11
- required(:firmware_url).filled :string
12
- optional(:firmware_version).maybe :string
13
11
  required(:image_url).filled :string
12
+ optional(:image_url_timeout).filled :integer
14
13
  required(:refresh_rate).filled :integer
14
+ optional(:firmware_version).filled :string
15
+ required(:firmware_url).filled :string
15
16
  required(:reset_firmware).filled :bool
16
- required(:special_function).filled :string
17
17
  required(:update_firmware).filled :bool
18
+ optional(:maximum_compatibility).filled :bool
19
+ optional(:temperature_profile).filled :string
20
+ optional(:touchbar_mode).filled :string
21
+ optional(:action).filled :string
22
+ optional(:playlist_image_names).filled(:array).each(:string)
18
23
  end
19
24
  end
20
25
  end
@@ -22,6 +22,7 @@ module TRMNL
22
22
  required(:offset_x).filled :integer
23
23
  required(:offset_y).filled :integer
24
24
  required(:palette_ids).array(:string)
25
+ required(:default_palette_id).filled :string
25
26
  optional(:css).hash do
26
27
  optional(:classes).hash do
27
28
  required(:density).filled :string
data/trmnl-api.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "trmnl-api"
5
- spec.version = "0.22.0"
5
+ spec.version = "0.23.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/trmnl-api"
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.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  - !ruby/object:Gem::Version
273
273
  version: '0'
274
274
  requirements: []
275
- rubygems_version: 4.0.22
275
+ rubygems_version: 4.0.24
276
276
  specification_version: 4
277
277
  summary: A monadic TRMNL API client.
278
278
  test_files: []
metadata.gz.sig CHANGED
Binary file