espruino / BangleApps

Bangle.js App Loader (and Apps)
https://banglejs.com/apps
MIT License
496 stars 1.17k forks source link

[lcars/advcasio/cassioWatch/entonclk] don't report heart rate properly #2395

Closed gfwilliams closed 1 year ago

gfwilliams commented 1 year ago

It seems many clocks report HRM and use this pattern:

Math.round(Bangle.getHealthStatus("last").bpm)

But this returns the best HRM in the last 10 minutes - so it won't update for between 0-10 minutes.

Probably what's needed is really:

Math.round(Bangle.getHealthStatus().bpm||Bangle.getHealthStatus("last").bpm)

To get the 'best' HRM reading from this 10 minutes, or the reading from the last 10 minutes, or 0... and maybe even updating based on the HRM event.

But the best way would be to use the new clock_info module instead as this handles it properly now, and we can keep it updated if we spot issues like this in the future.

Affected:

siatko commented 1 year ago

[entonclk] Thanks for pointing that out. As soon as I have time, I will rewrite my watchface with clock_info.

amunizp commented 1 year ago

@peerdavid and @Ronin0000 I don't know how to do clockinfo but copy and pasted patch.