theengs / app

Theengs mobile application to read BLE sensors and push data to an MQTT broker
https://app.theengs.io
GNU General Public License v3.0
37 stars 7 forks source link

Extend the Xiaomi Mi scales widgets to include weighing_mode #9

Closed DigiH closed 1 year ago

DigiH commented 2 years ago

While trying out and testing

https://github.com/theengs/app/issues/8

and the Xiaomi Mi scales widget not showing any details for me, and digging in the code briefly I saw that currently only only the weight and impedance is included for display.

else if (boxDevice.isScale) {
                if (boxDevice.hasImpedance)
                    loaderIndicators.sourceComponent = componentText_2l
                else
                    loaderIndicators.sourceComponent = componentText_1l
            }
else if (boxDevice.isScale) {
                    text.text = (settingsManager.tempUnit === 'C') ? boxDevice.weight.toFixed(1) : (boxDevice.weight * 2.20462).toFixed(1)
                    unit.text = (settingsManager.tempUnit === 'C') ? qsTr("kg") : qsTr("lbs")
                }
…
else if (boxDevice.isScale) {
                    textOne.font.pixelSize = bigAssMode ? 26 : 24
                    textTwo.font.pixelSize = bigAssMode ? 22 : 20

                    textOne.text = (settingsManager.tempUnit === 'C') ? boxDevice.weight.toFixed(1) + qsTr("kg") : (boxDevice.weight * 2.20462).toFixed(1) + qsTr("lbs")
                    if (boxDevice.impedance > 0) textTwo.text = boxDevice.impedance + " Ω"
                }

This is a feature request to also include the weighing_mode for both models inn the widget on all platforms.

DigiH commented 1 year ago

Closing as verified as implemented with iOS test build 1.1 (1010002)