137 Commits
Author SHA1 Message Date
Brooke Kuhlmann 98d4f1e6ce Updated device delete actions to use deleter
Ensures all actions use the new deleter for consistent behavior.

Milestone: minor
2026-08-05 15:10:08 -06:00
Brooke Kuhlmann c273ec2112 Fixed firmware and screen attachments
This reverts commit 5e9ab0cf02 (Removed screen and firmware struct attachment replace behavior, 2026-08-03) because you can't reliably have link:https://shrinerb.com[Shrine] upload a replacable image. We still need to have distinct methods for `#replace` and `#upload`.

This also prevents duplicate images being created.

Milestone: patch
2026-08-05 13:29:07 -06:00
Brooke Kuhlmann 5e9ab0cf02 Removed screen and firmware struct attachment replace behavior
We can safely remove the `#remove` method in favor of using `#upload` for everything now that we conditionally destroy the record only if found and the `*_data` key exists. This also updates firmware attachment behavior to mimic screen attachment behavior in order to improve consistency.

Milestone: minor
2026-08-03 16:47:46 -06:00
Brooke Kuhlmann 3e4c6ac8ad Updated to SimpleCov 1.0.0
link:https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md#100-2026-07-12[Details]. This includes the following:

* My long standing bug has been fixed which allows for implicit elses to be ignored. This cleans up code related to using monads with pattern matching which is nice to see.
* We still can't enable ERB code coverage (this is why the templates are skipped). I've logged a few more new bugs on the SimpleCov side to tackle. This might take a while because I noticed Erik Berlin logged issues with Ruby core in order to make this possible.
* Use of the *strict* profile ensures all code committed to this project must be 100%. This also cleans up having to be explicit about this.

Milestone: patch
2026-07-18 11:30:36 -06:00
Brooke Kuhlmann c67e011a6c Updated API display errors for invalid API key
When header information is invalid or missing, we'll emphasize that the device's API key must be used. This helps clear up any ambiguity when resolving the issue.

Milestone: minor
2026-07-14 17:19:25 -06:00
Brooke Kuhlmann fc849438c1 Updated API setup show action to provision via device API key
Now that the model (payload) knows how to incorporate the device's API key, we'll use the API key in the response to ensure the response is always the same (especially when the device can be found).

Milestone: minor
2026-07-14 17:18:16 -06:00
Brooke Kuhlmann be4ea99a26 Removed computed MAC address from firmware headers model
No longer necessary now that we can use the Setup API to set the API key for a device. This means you can use either the model ID or, soon, the API key.

Issue: 347
Milestone: minor
2026-07-14 15:29:32 -06:00
Brooke Kuhlmann b363fbbd4a Added API log creation action log level
Necessary to support log levels in future firmware versions. For now, the level, is optional but will be required in the future.

Milestone: minor
2026-06-30 11:07:39 -06:00
Brooke Kuhlmann 9d11c888f1 Updated API setup show action to use computed MAC address
As with done with the Display API, we'll delegate to the model to compute the MAC address when provisioning a device. This required refactoring the action to use a private provision device method.

The `HTTP_ID` missing header spec was deleted since this header is optional now.

Milestone: minor
2026-06-29 10:54:26 -06:00
Brooke Kuhlmann d470a36927 Removed device friendly ID and API implementation
These attributes were originally used for the Core proxy feature (and device provisioning) but are no longer needed. These changes completely remove these attributes (including the migration for removing from the `device` table).

Issue: 326
Milestone: minor
2026-06-10 11:32:51 -06:00
Brooke Kuhlmann f22fe48b73 Updated device struct display attributes
Applies the following:

* Renames the method to be consistent with other attribute-based methods.
* Adds missing Display API attributes.
* Ensures the attributes surface user settings as stored in the database.

Milestone: minor
2026-06-03 10:57:47 -06:00
Brooke Kuhlmann 39414eb526 Refactored problem details within errors namespace
Cleans up the error objects so they are in the same namespace for quick lookup. This includes renaming `ProblemDetail` as `Problem` and using `petail` for `Petail` to clarify the differences.

Milestone: patch
2026-05-18 15:41:58 -06:00
Brooke Kuhlmann 080c599185 Refactored models as firmware aspects
The original thought was that multiple models would be a top-level namespace within the `app` folder but, in practice, it makes more sense to keep these whole value objects associated with the correct aspect.

Milestone: patch
2026-05-07 11:43:42 -06:00
Brooke Kuhlmann 3347c9829d Fixed Setup API to use firmware header parser
Necessary to reduce duplication by using the firmware header parser so we don't have to maintain a custom contract for this action. This also relaxes the requirements for having firmware version and model information. Only the HTTP ID header is important.

Milestone: patch
2026-05-07 11:43:42 -06:00
Brooke Kuhlmann aa1dd53544 Refactored implementation to use Core constants
Reduces typing and fixes issues with the views not requiring this functionality for improved consistency.

Milestone: patch
2026-04-26 11:26:00 -06:00
Brooke Kuhlmann 5c6c380b21 Updated Models API to use default palette
Necessary to be in sync with the UI by supporting default palettes via the API. This also removes the use of palette names since using the default palette is preferred now.

Issue: 303
Milestone: minor
2026-04-21 14:57:30 -06:00
Brooke Kuhlmann ce03c0696a Refactored problem details terminology and status
Improves consistency and also ensure the reponse status is the same status as set by the problem detail.

Reek has been updated to account for feature envy since Reek is overly zealous about two messages to the same object (which is fine for these situations).

Milestone: patch
2026-04-02 15:23:15 -06:00
Brooke Kuhlmann f9b55e2c37 Added API base action handling of unique constraints
Ensures the API answers HTTP Conflict (409) problem details when a unique contraint is encountered. This improves the user experience while also giving detailed information on how to correct.

Reek has been updated as follows:

* *Data Clump*: This can't be avoided without additional effort since there'd need to be a more advanced error routing system to account for the clumping of the request, response, and error objects. This might be worth exploring more in the future.
* *Feature Envy*: Reek doesn't like more than one call to the same object. This is a known issue since this is too strict for use cases like this.

Milestone: minor
2026-04-02 15:23:14 -06:00
Brooke Kuhlmann f52a3b5e1d Updated Models API create and patch parameters
Allows folks to tap into all supported model attributes which brings the API up to parity with what you can do in the UI.

Milestone: patch
2026-04-02 08:29:26 -06:00
Brooke Kuhlmann 048b3fdc55 Added Screens API mode for create and patch actions
Necessary so folks can force a screen to be dithered if desired. This is especially important working with contant that is artistic or more photography focused in general.

Issue: 294
Milestone: minor
2026-03-30 14:05:02 -06:00
Brooke Kuhlmann dd442b5390 Removed Base64 encoded image data for Screen API requests
As done with the Display API, this removes Base64 encoded data when creating/updating screens.

Milestone: minor
2026-03-26 19:33:49 -06:00
Brooke Kuhlmann 2560587ed5 Removed Base64 encoding from API display requests
Base64 encryption was a carry over from the early days of this project when moving away from Sinatra. This is safe to remove since our Firmware doesn't make (or need) API requests with Base64 encoding enabled.

Issue: 290
Milestone: minor
2026-03-24 14:51:54 -06:00
Brooke Kuhlmann f275ac17bb Updated API setup show action to use model name transformer
Necessary to reduce duplication by using the same model name transformer as used by the `Terminus::Aspects::Firmware::Headers::Parser`. This also _requires_ all the following HTTP headers to be present to improve model lookup:

* `HTTP_FW_VERSION`
* `HTTP_ID`
* `HTTP_MODEL`

As mentioned when originally adding the `ModelName` transformer, all of this is a _best guess_ with a fallback to `og_png` when we can't match what the Firmware provides for us via the `HTTP_MODEL` header because the Firmware provides so little information.

Milestone: minor
2026-03-16 12:20:03 -06:00
Brooke Kuhlmann e26a8ead3e Updated Screens API create action to accept playlist ID
Necessary to associate a screen with a playlist if desired.

Milestone: minor
2026-03-05 14:08:21 -07:00
Brooke Kuhlmann 8a65dc6b19 Added Playlists API delete action
Necessary to delete an existing record.

Issue: 200
Milestone: minor
2026-03-04 17:43:04 -07:00