Enable / disable heart rate sensor

Hi,

I'll like to disable the heart rate ensor when I sleep because of the green light of it and enable it when I wake uo.

I've seen these 2 events : 

  function onWakeTimeEvent() {
      System.println("Enable sensor Hear Rate");
  }

  function onSleepTimeEvent() {
      System.println("disable sensor Hear Rate");
  }
But don't find how to enable / disable this sensor from the API
Thanks for the help.
best regards,
Alban