QN-Scale Type 1 fix
Hi, I tried to come up with something to resolve #1190. As I pointed out there: I wasn't quite smart enough to suddenly learn Kotlin, etc. Yet, there's Anthropic's Claude (free version). So I asked what's the difference between the old Java version and the new Kotlin version. I also asked it to help me understand how the differences relate to the logging I was able to produce. I then proceeded to have it suggest a fix for it and help me build a debug build. Which it did. So I ended up testing it on my phone and - lo and behold - it worked.
What I understood kind of makes sense to me. The flow of messages was altered so it kind of revised it back to how it used to be and now it works. I couldn't test with type 2 so I cannot say if I created a regression. I am also not sure if the use of an LLM helped me comply with standards you otherwise observe. So all considered... well... I hope you can pull as is or suggest something to help me improve things to a point where you can do the pull. I would really like to continue weighing my children sometime soon. :-D
Oh, one thing I also noticed is that Claude was suggesting the following change. The snippet
if (weightKg <= 5f || weightKg >= 250f) {
weightKg = weightKg / 10.0f
was suggested to be replaced by
if (weightKg <= 5f || weightKg >= 250f) {
weightKg = raw / 10.0f
logD("QN: weight adjustment applied, new weight=$weightKg kg")
Feels wrong judging by the fact that it pretty much went unchanged during the conversion from Java to Kotlin. Just thought I'd still share. :-)
Thanks for the fix, I can't test it as I don't own this scale but if it works.
Does this mean a dev version should have this fix in it? I have the most recent version available in F-Droid, 3.0 from 2025-12-01, and as of 2026-01-01, it was not working with the QN-Scale.