 
 void soundAlarmA(bool status) {
   digitalWrite(soundAPin, (status ? LOW : HIGH));
+  soundAlarmAPlaying = status;
 }
 
 void soundAlarmB(bool status) {
   digitalWrite(soundBPin, (status ? LOW : HIGH));
+  soundAlarmBPlaying = status;
 }
 
 uint32_t alarmStartMillis = 0;

{
  for (uint8_t i = 0 ; i < 3 ; ++i)
  {
    targetColor[i] = tungsten100W[i];
  }
  minRGBLevel = computeMinRGBLevel(targetColor);
  totalDimmerSteps = minRGBLevel * NUM_LED;

  writeAlarmTimeToEEPROM();
  digitalWrite(AlarmLED, LOW);
  alarmEnabled = true;
  snoozeActive = false;
}

uint32_t millisAtStartOfSunSet = 0;
bool sunSetActive = false;
void setSunSet() {
  setColorForSunSet();
  matrix.print(sunSetDimLevel);
  if (sunSetDimLevel == 0) {
    matrix.writeDigitNum(4, 0);
  }
  matrix.writeDisplay();
  sunSetActive = true;
  turnLightOn();
  waitForButtonDepress(rotaryButton, LOW);
  uint32_t modeActive = millis();
  bool normalExit = true;
  while (debounceDigitalRead(rotaryButton) == HIGH) {
    int16_t encoderDelta = encoder->getValue();
    if (encoderDelta != 0)
    {
      sunSetDimLevel += encoderDelta;
      sunSetDimLevel = min(100,max(0, sunSetDimLevel));
      matrix.print(sunSetDimLevel);
      if (sunSetDimLevel == 0) matrix.writeDigitNum(4, 0);
      matrix.writeDisplay();
      setColorForSunSet();
      turnLightOn();
      modeActive = millis();
    }
    if (static_cast<uint32_t>(millis() - modeActive) > modeInactivePeriod) {
      normalExit = false;
      break;
    }
  }
  if (sunSetDimLevel == 0) {
    sunSetActive = false;
    turnLightOff();
  }
  if (normalExit) {
    waitForButtonDepress(rotaryButton, LOW);
  }
  writeSunSetDimToEEPROM();
  millisAtStartOfSunSet = millis();
}

