Skip to content

feat(scale): add manual USB-powered override for Skale - #745

Open
MaxRink wants to merge 1 commit into
decentespresso:mainfrom
MaxRink:feat/skale-usb-power-override-716
Open

MaxRink wants to merge 1 commit into
decentespresso:mainfrom
MaxRink:feat/skale-usb-power-override-716

Conversation

@MaxRink

@MaxRink MaxRink commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a default-off “Powered by USB” declaration for each native Skale. Persist enabled device IDs, apply settings independently, suppress battery reads while enabled, and refresh battery metadata when disabled.

Linked Issue

Fixes #716

Verification

  • Combined Linux Flutter gate for the current publication stack: 4,315 passed, 1 skipped, 0 failed; analyzer clean (48.0s). Source was unchanged during the gate.

  • Combined simulated runtime checks passed for the current stack; no production fixes were needed during runtime validation.

Impact

The manual declaration is stored in skalePoweredByUsbByDevice, including REST settings and export/import. Only enabled IDs are stored. It does not detect electrical power. Connected metadata uses the narrow DeviceInformationCapable capability; /api/v1/scale/info remains limited to firmware and optional battery, and device inventory REST/WS contracts remain unchanged. Low-battery warning policy remains in #717. This branch includes the firmware and battery foundations from #742 and #743. API and device documentation are updated.

Contributor Responsibility

AI-assisted development is allowed. The submitter remains responsible for the submitted work.

  • I have reviewed and understand all changes in this PR and take responsibility for their correctness, security, behavior, licensing, and provenance, including any AI-assisted or AI-generated work.

@tadelv tadelv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the orphan DeviceInformation components from both REST and WebSocket specs here as well. This branch currently extends those unused schemas with powerSource / powerSourceProvenance, which makes the public specs imply a metadata API that the corrected architecture explicitly does not provide. The PR body now says /api/v1/scale/info stays limited to firmware/battery and USB is a manual per-device setting; the specs should match that boundary. Keep the internal DeviceInformation fields for the native Devices UI if needed, and expose the manual override through the settings contract only.

@MaxRink

MaxRink commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the orphan-schema review in 4c103e0: removed DeviceInformation from both REST and WebSocket components, including the unused powerSource/powerSourceProvenance properties. ScaleInfo, internal native-UI metadata, and the manual USB override settings remain unchanged.

@MaxRink
MaxRink force-pushed the feat/skale-usb-power-override-716 branch from 2a94bd0 to 275feae Compare September 14, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(scale): add a manual USB-powered override for Skale

2 participants