Acknowledged
CIQQA-3115

bug: System.getSystemStats().battery is Number instead of Float

According to the docs: Toybox.System.Stats.battery as Float, but on real fr965 it is a Number or at least it's value is always a Number (without decimal).

function initialize() {
    session = ActivityRecording.createSession({
	 	:name => "test",
	 	:sport => Activity.Sport.SPORT_RUNNING,
	 	:subSport => Activity.SubSport.SUB_SPORT_TREADMILL
	});
    batteryPercentageField = session.createField("battery", 11, FitContributor.DATA_TYPE_FLOAT, { :mesgType => FitContributor.MESG_TYPE_RECORD, :units => "%" });
}

function compute() as Void {
    batteryPercentageField.setData(System.getSystemStats().battery);
}

Parents
  • Btw, if the API is returning SystemStats.battery as a literal Number type, that would be an unambiguous bug, as it would contradict the type information and documentation.

    If the API is returning SystemStats.battery as a literal Float type, but its value is always an integer, that would be annoying (and perhaps limiting for some use cases) but arguably less of a bug.

Comment
  • Btw, if the API is returning SystemStats.battery as a literal Number type, that would be an unambiguous bug, as it would contradict the type information and documentation.

    If the API is returning SystemStats.battery as a literal Float type, but its value is always an integer, that would be annoying (and perhaps limiting for some use cases) but arguably less of a bug.

Children
No Data