Fade without interruptions?

Hi, I am trying to do the sleep for a battery operated device, and I wonder how can I do a x seconds fade without being interrupted?

Is it ok to use something like (this is in the loop, called every 100 ms):

  if (strip.getBrightness() == 0)
    esp_deep_sleep_start(); // real sleep here

  bri = strip.getBrightness() - 1;

But how can I prevent the user to increase the brightness via the webUI while the fading is happening?