-
Notifications
You must be signed in to change notification settings - Fork 26
feat(scale): add manual USB-powered override for Skale - #745
Open
MaxRink wants to merge 16 commits into
Open
Conversation
MaxRink
force-pushed
the
feat/skale-usb-power-override-716
branch
from
September 5, 2026 23:56
b4ef434 to
4514d73
Compare
MaxRink
marked this pull request as ready for review
September 6, 2026 09:41
Centralize USB-power setting application and remove duplicate state, resets, and test-only interface surface identified during the ponytail review. Discovered devices still receive the setting before connection without publishing inactive metadata. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The top-right Settings page did not link to the existing Devices page, leaving firmware and scale controls hidden behind the launcher navigation. Add a direct Devices row so connected-device metadata and settings are reachable from the expected entry point. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The manual USB-power override was rendered as a global switch at the bottom of the Devices page, leaving it effectively hidden and detached from the Skale it configures. Move the control behind a settings button on USB-configurable scale rows without changing its persisted global Skale semantics or battery-refresh behavior. Update the widget coverage and device-management documentation to reflect the discoverable Settings > Devices path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Device Management is now reachable from the regular Settings page as well as the dashboard. Record both entry points so the user-facing navigation documentation matches the new discoverable route. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The USB override only produces usb with manualOverride, while the device-information enums and API schemas advertised three unused sources and an unused provenance. Keep the contract honest to implemented behavior, remove serializer-only coverage already exercised through the Devices API, and detect configurable scale rows directly instead of passing a one-use callback through the section builder. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All three USB propagation tests repeated the same discovery, settings, and controller initialization. Extract that fixture construction into one helper so each test shows only the behavior it varies while retaining explicit cleanup and disposal coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The USB-power override was global, which made one Skale setting overwrite the power-source behavior of every configurable scale. Persist enabled device IDs, expose the per-device map through settings export and REST, and apply each value only to its matching device. Disabled entries are removed so the stored contract remains compact and defaults safely to battery reporting. The native device dialog and tests now verify independent settings for two Skales and same-ID replacement devices. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MaxRink
force-pushed
the
feat/skale-usb-power-override-716
branch
from
September 6, 2026 18:32
ba976b9 to
11aa1ae
Compare
Expose generic connected-scale metadata through /api/v1/scale/info while keeping device inventory limited to discovery and connection state. Keep metadata refreshes out of the inventory WebSocket and align the API contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the router's parameterized GET form so the connected-scale metadata endpoint is reachable, and align inventory tests with the boundary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep scale metadata on the connected-scale endpoint and update affected implementations and tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep inventory payloads metadata-free and cover connected scale info responses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Uh oh!
There was an error while loading. Please reload this page.
Summary
What changed, and why?
Powered by USBsetting keyed by exact device ID and defaulting off.usbwithmanualOverrideprovenance.Linked Issue
Fixes #716
Verification
flutter analyzecompleted with no issues.ScaleHandler.addRoutes()coverage verifiesGET /api/v1/scale/info, disconnected503, connected metadata serialization, REST and WebSocket inventory metadata exclusion, and no inventory emission for metadata refresh.xcodebuild; Android requires a missingdebug.keystore. An existing port-8080 ADB issue is unrelated and unchanged.Impact
Note any user-visible behavior, compatibility, migration, API/spec, documentation, or security impact. Write
Noneif there is none.skalePoweredByUsbByDeviceparticipates in persistence, export/import, and the REST settings contract. Only enabled device IDs are stored.DeviceControllerapplies each device's own value.GET /api/v1/scale/infoScaleInfo.Contributor Responsibility
AI-assisted development is allowed. The submitter remains responsible for the submitted work.
API boundary
Connected-scale metadata is exposed through
GET /api/v1/scale/infoasScaleInfo. The inventory REST endpoint/api/v1/devicesand the/ws/v1/devicesstream do not exposedeviceInfoor emit metadata-only inventory refreshes; device-specific settings and native metadata UI remain supported separately.