Acknowledged

SDK 7.3.0 --> BodyBatteryHistory broken

function getIteratorBodyBattery() {
    // Check device for SensorHistory compatibility
    if ((Toybox has :SensorHistory) && (Toybox.SensorHistory has :getBodyBatteryHistory)) {
        return Toybox.SensorHistory.getBodyBatteryHistory({});
    }
    return null;
}

var intBB = 0;
var sensorIterBodyBattery = getIteratorBodyBattery();
if (sensorIterBodyBattery != null) {
    intBB = sensorIterBodyBattery.next().data / 100;
}

Line 12:
intBB = sensorIterBodyBattery.next().data / 100;
stops with error in SDK 7.3.0:
Details: Failed invoking <symbol>

There is no probnlem with that in SDK 7.2.1:

SDK 7.2.1
sensorIterBodyBattery:
----------------------

mMax = 37 (Lang.Number)
mMin = 35 (Lang.Number)
mNewestSampleTime = Lang.Object
mOldestSampleTime = Lang.Object

Values with SDK 7.3.0:

SDK 7.3.0
sensorIterBodyBattery:
----------------------

mMax = 0 (Lang.Number)
mMin = 127 (Lang.Number)
mNewestSampleTime = Lang.Object
 mDateTime = 0 (Lang.Number)
mOldestSampleTime = Lang.Object
 mDateTime = 0 (Lang.Number)

The minimum-value is 127 (body battery cannot be greater than 100) and die maximum value is 0 (max is smaller than min).
The setup of the simulator is identically.
IMHO there is bug in
Toybox.SensorHistory.getBodyBatteryHistory({})

Is there an idea to fix that?

Greetings,
Ronny

Parents
  • I'm revisiting this because of a separate conversation I've been having about this, and I realize I misunderstood the nature of the issue. Like you said, the :period option cannot be null, even though the docs state this is allowed (there is probably more it than that... the other person I'm speaking with gets it to work if a Number is supplied to :period). So it appears there is a bug after all. I'll get this reported.

Comment
  • I'm revisiting this because of a separate conversation I've been having about this, and I realize I misunderstood the nature of the issue. Like you said, the :period option cannot be null, even though the docs state this is allowed (there is probably more it than that... the other person I'm speaking with gets it to work if a Number is supplied to :period). So it appears there is a bug after all. I'll get this reported.

Children
No Data