Add support for Eufy C20#1356
Open
cvoinf wants to merge 12 commits intooliexdev:masterfrom
Open
Conversation
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 })
Author
|
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. |
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.
Continuation of #1355