Repository navigation
feat: Kindle control panel reports the device and queues commands - #6
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The app couldn't see what was on the Kindle or act on it. Deleting a book or forcing a rescan meant plugging the Kindle in.
How
On every wake, the Kindle reports its battery, free and total space, firmware and library, then runs any commands the app queued. The new Kindle screen (the tablet button in the Library header) shows the last report and queues commands for the next wake.
Worker (
src/Api.ts). New endpoints:PUT /device: the Kindle's report, form-encoded sots.shcan send it with curl.POST /commands,DELETE /commands/:id: the app queues or cancels a command.GET /commands/,PUT /commands/:id: the Kindle lists pending commands as tab-separated text, then settles each one withokorfailedplus a message./statusnow includesdeviceandcommands. Commands areDeleteBook { path }andRescan. A delete path must be inside/mnt/us/documentswith no.or..segments, or the Worker returns 400. Commands expire after 30 days through an R2 lifecycle rule.App.
Noticegains an optional action, which is in the component catalog.Kindle (
ts.sh, in the kindle repo).run_commandsdeletes the book, its.sdrand both cover thumbnails, settles each command, and rescans once if anything ran.report_devicereadslipc,dfand the firmware version.EBOKandPDOCentries fromcc.db, so KUAL, hotfix runners and other indexed non-books never reach the app.The
ts.shchange ships to the Kindle separately and isn't part of this PR. It needs this Worker deployed first.No native change: the Android fingerprint matches
main's, so this ships OTA.apps/workermoves to@cloudflare/workers-typesv5 for R2'sincludelist option.Verification
check:changedpasses.lipcbattery and charging, the firmware version anddfall read correctly.ok.The screenshots live on the
assets/control-panelbranch, which can be deleted after merge.