Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timer is null , createTimer undefined #57

Open
MatthiasDM opened this issue Apr 18, 2024 · 0 comments
Open

timer is null , createTimer undefined #57

MatthiasDM opened this issue Apr 18, 2024 · 0 comments

Comments

@MatthiasDM
Copy link

I am trying to create a timer to update the time for a watchface for the Amazfit band 7 which uses ZeppOS v1.0 API.

function startClock() {
  const timer1 = timer.createTimer(
    500, 
    1000, 
    function () {
      drawTime(); // Call the function to update the time on the screen
    }
  );

  // Optionally, keep a reference to the timer if you need to stop it later
  this.timer = timer1;
}

function stopClock() {
  if (this.timer) {
    timer.stopTimer(this.timer);
  }
}

But the typeof timer is null and thus createTimer is undefined

According to the API docs: https://docs.zepp.com/docs/1.0/watchface/api/timer/createTimer/ there should be a timer object available. (somehow it is null, not undefined).

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant