Hi everyone! I'm working on a watch face for the T-Rex 3 and I'm facing a battery drain issue because the compass is constantly active.
Is there a way to implement a 'tap-to-toggle' feature to turn the compass (magnetometer) on/off? Or perhaps a way to set its update interval to save battery life? If anyone has experience with this in Zepp OS, I would appreciate any tips or code snippets. Thanks!
-
- Amministratore
-
-
Support Ukraine
If you experience any problems with the forum (it is not visible, there is no way to post messages, or some functionality does not work), please let us know. If you have problems with registration or you did not receive confirmation letter, let us know and we will activate your account manually.
If you get an "The submitted form was invalid. Try submitting again" error, delete cookies, then try again.
Battery Drain & Compass Control on T-Rex 3 (Zepp OS)
Regole del forum
When adding a new topic, use the template: Topic title [device name]
For example: Requesting creation of watch face [T-Rex Pro]
All communication in this branch should only be in English.
When adding a new topic, use the template: Topic title [device name]
For example: Requesting creation of watch face [T-Rex Pro]
All communication in this branch should only be in English.
-
jimibamper
- Messaggi: 2
- Iscritto il: 19 mar 2026, 19:18
- Località: Ukraine
- Contatta:
- asoo
- Messaggi: 2110
- Iscritto il: 03 gen 2019, 01:48
- Località: ͼͽ Thailand ͼͽ
- Has thanked: 405 times
- Been thanked: 2025 times
jimibamper ha scritto: 27 mar 2026, 06:23Hi everyone! I'm working on a watch face for the T-Rex 3 and I'm facing a battery drain issue because the compass is constantly active.
Is there a way to implement a 'tap-to-toggle' feature to turn the compass (magnetometer) on/off? Or perhaps a way to set its update interval to save battery life? If anyone has experience with this in Zepp OS, I would appreciate any tips or code snippets. Thanks!
I'm not sure how you scripted the compass to run constantly, but if you're using Sasha's editor, I don't think the power consumption to much is due to the compass itself.
Because the editor already has this script to control on/off widget compass
Codice: Seleziona tutto
pause_call: (function () {
console.log('pause_call()');
if (compass) compass.stop();
}),
resume_call: (function () {
console.log('resume_call()');
if (compass && screenType == hmSetting.screen_type.WATCHFACE) compass.start();
}),I think the high power consumption might be due to other widgets, or you might be using many widgets on your watchface, or in the AOD you might be calling seconds. I can only speculate because you haven't provided a project for further investigation.
Or, if you're sure the problem is actually with the compass, you could create buttons to disable or enable the functions:
compass.stop()
compass.start()
yourself, without having to use them through:
pause_call:
resume_call:
Examples of using the compass on/off button :
If you are using Sasha's editor to create a compass widget and want to switch to a direct compass on/off control button,
remember to remove the controls in resume_call and pause_call
Codice: Seleziona tutto
-------------------------------- resume and pause in index.js --------------------------------------------
resume_call: (function () {
console.log('resume_call()');
// if (compass && screenType == hmSetting.screen_type.WATCHFACE) compass.start(); // remove this line
}),
pause_call: (function () {
console.log('pause_call()');
// if (compass) compass.stop(); // remove this line
}),Therefore, I think "resume_call" and "pause_call" are the most appropriate solutions.
ͼͽ To request please use the interrelated forum in action ͼͽ
Please do not PM to me for requests ported watchface.
Please do not PM to me for requests ported watchface.
-
jimibamper
- Messaggi: 2
- Iscritto il: 19 mar 2026, 19:18
- Località: Ukraine
- Contatta:
Chi c’è in linea
Visitano il forum: Nessuno e 1 ospite