The following calls return null when trying to get the stress history on an Instinct 2:
if (Toybox.SensorHistory has :getStressHistory) {
return Toybox.SensorHistory.getStressHistory(
{:period => null});
}
if (Toybox.SensorHistory has :getStressHistory) {
return Toybox.SensorHistory.getStressHistory(
{:period => null, :order => SensorHistory.ORDER_OLDEST_FIRST});
}
However this call does not and I can read the last stress value
if (Toybox.SensorHistory.getStressHistory({:period=>1})!=null){
............
}
Version info
- Device Name: Instinct 2 APAC
- Firmware Version: 13.21
An update to this. Both these snippets also return a null iterator:
if (Toybox.SensorHistory has :getStressHistory) {
return Toybox.SensorHistory.getStressHistory(
{:period => 360, :order => SensorHistory.ORDER_OLDEST_FIRST});
}
if (Toybox.SensorHistory has :getStressHistory) {
return Toybox.SensorHistory.getStressHistory(
{:period => 360});
}