Skip to content

Add support for Eufy C20#1356

Open
cvoinf wants to merge 12 commits intooliexdev:masterfrom
cvoinf:master
Open

Add support for Eufy C20#1356
cvoinf wants to merge 12 commits intooliexdev:masterfrom
cvoinf:master

Conversation

@cvoinf
Copy link
Copy Markdown

@cvoinf cvoinf commented Apr 22, 2026

Continuation of #1355

cvoinf added 9 commits April 22, 2026 20:36
Use a short timeout that keeps the partial measurement alive for a few seconds after you first see the device, and only clear it when that timeout expires. Also update the "last seen" timestamp whenever you get relevant data so you extend the wait.
- Replaced unsafe casts in extractManufacturerIds with safe checks (Map, SparseArray, List<Pair<*,*>>) to remove unchecked-cast warning.
- Removed unnecessary Elvis usage for device.name; explicit null check used instead.
- Made manufacturerSpecificData parsing safe: treat as SparseArray<*> and map values with safe ByteArray casts to remove "no cast needed" warning.
- Reintroduced a single global nullable stored: create local non-null alias (val s = stored ?: ScaleMeasurement().also { stored = it })
@cvoinf
Copy link
Copy Markdown
Author

cvoinf commented Apr 23, 2026

It works now quite well. Only one problem persists: If I update s.dateTime while keeping scanning, a new measurement is generated, what I want to avoid. But if it is not updated, an updated weight is not shown in the app. When weight, heartrate and impedance have been all sent by the scale, I update dateTime, and all information is transmitted.
Is there another possibilty to publish a measurement preliminarily (Live-Scan)?

@cvoinf cvoinf mentioned this pull request May 3, 2026
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.

1 participant