Browse Source

Fixing compile-issues with FTP/MQTT

master
Torsten Stauder 4 years ago
parent
commit
66faf55513
  1. 11
      src/Ftp.cpp
  2. 18
      src/System.cpp

11
src/Ftp.cpp

@ -68,9 +68,14 @@ void Ftp_Cyclic(void) {
}
void Ftp_EnableServer(void) {
if (Wlan_IsConnected() && !ftpEnableLastStatus && !ftpEnableCurrentStatus) {
ftpEnableLastStatus = true;
System_IndicateOk();
#ifdef FTP_ENABLE
if (Wlan_IsConnected() && !ftpEnableLastStatus && !ftpEnableCurrentStatus) {
ftpEnableLastStatus = true;
#else
if (Wlan_IsConnected()) {
#endif
System_IndicateOk();
} else {
Log_Println((char *) FPSTR(unableToStartFtpServer), LOGLEVEL_ERROR);
System_IndicateError();

18
src/System.cpp

@ -74,7 +74,9 @@ bool System_SetSleepTimer(uint8_t minutes) {
System_SleepTimerStartTimestamp = 0u;
Led_ResetToInitialBrightness();
Log_Println((char *) FPSTR(modificatorSleepd), LOGLEVEL_NOTICE);
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false);
#ifdef MQTT_ENABLE
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false);
#endif
} else {
System_SleepTimer = minutes;
System_SleepTimerStartTimestamp = millis();
@ -82,8 +84,10 @@ bool System_SetSleepTimer(uint8_t minutes) {
Led_ResetToNightBrightness();
Log_Println((char *) FPSTR(modificatorSleepTimer60), LOGLEVEL_NOTICE);
publishMqtt((char *) FPSTR(topicSleepTimerState), System_SleepTimer, false);
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false);
#ifdef MQTT_ENABLE
publishMqtt((char *) FPSTR(topicSleepTimerState), System_SleepTimer, false);
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false);
#endif
}
return sleepTimerEnabled;
@ -118,11 +122,15 @@ void System_ToggleLockControls(void) {
if (System_LockControls) {
Log_Println((char *) FPSTR(modificatorAllButtonsLocked), LOGLEVEL_NOTICE);
publishMqtt((char *) FPSTR(topicLockControlsState), "ON", false);
#ifdef MQTT_ENABLE
publishMqtt((char *) FPSTR(topicLockControlsState), "ON", false);
#endif
System_IndicateOk();
} else {
Log_Println((char *) FPSTR(modificatorAllButtonsUnlocked), LOGLEVEL_NOTICE);
publishMqtt((char *) FPSTR(topicLockControlsState), "OFF", false);
#ifdef MQTT_ENABLE
publishMqtt((char *) FPSTR(topicLockControlsState), "OFF", false);
#endif
}
}

Loading…
Cancel
Save