Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BrewPiLess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1702,12 +1702,12 @@ void handleReset()

void brewpi_setup()
{
if (SONOFF_NEWGEN) {
#if SONOFF_NEWGEN
pinMode(sensorPowerPin, OUTPUT); // Power for sonoff temp sensor
digitalWrite(sensorPowerPin, HIGH);
pinMode(powerIndicatorPin, OUTPUT);
digitalWrite(powerIndicatorPin, LOW); // Red power led
}
#endif
#if defined(ESP8266)
// We need to initialize the EEPROM on ESP8266
EEPROM.begin(MAX_EEPROM_SIZE_LIMIT);
Expand Down
8 changes: 5 additions & 3 deletions src/TempControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ uint16_t TempControl::waitTime;
#endif

void TempControl::init(void){
if (SONOFF_NEWGEN) {
#if SONOFF_NEWGEN
pinMode(relayIndicatorPin, OUTPUT);
}
#endif
state=IDLE;
cs.mode = MODE_OFF;

Expand Down Expand Up @@ -402,12 +402,14 @@ void TempControl::updateOutputs(void) {
heater->setActive(!cc.lightAsHeater && heating);
light->setActive(isDoorOpen() || (cc.lightAsHeater && heating) || cameraLightState.isActive());
fan->setActive(heating || cooling);
if (SONOFF_NEWGEN && (heating || cooling)) {
#if SONOFF_NEWGEN
if (heating || cooling) {
digitalWrite(relayIndicatorPin, LOW);
}
else {
digitalWrite(relayIndicatorPin, HIGH);
}
#endif
}


Expand Down
12 changes: 6 additions & 6 deletions src/WiFiSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ bool WiFiSetupClass::isApMode(){
void WiFiSetupClass::begin(WiFiMode mode, char const *ssid,const char *passwd,char const* targetSSID,const char *targetPass)
{
wifi_info("begin:");
if(SONOFF_NEWGEN) {
#if SONOFF_NEWGEN
pinMode(wifiIndicatorPin, OUTPUT); // Blue Wifi led
}
#endif
if(targetSSID && targetSSID[0]){
if(_targetSSID) free((void*)_targetSSID);
_targetSSID=strdup(targetSSID);
Expand Down Expand Up @@ -195,9 +195,9 @@ String WiFiSetupClass::status(void){

bool WiFiSetupClass::stayConnected(void)
{
if(SONOFF_NEWGEN) {
#if SONOFF_NEWGEN
digitalWrite(wifiIndicatorPin, HIGH);
}
#endif
if(WiFi.getMode() == WIFI_AP || WiFi.getMode() == WIFI_AP_STA){
dnsServer->processNextRequest();
// if(_mode == WIFI_AP) return true;
Expand Down Expand Up @@ -348,9 +348,9 @@ bool WiFiSetupClass::stayConnected(void)
} // WiFi.status() != WL_CONNECTED
else // connected
{
if(SONOFF_NEWGEN) {
#if SONOFF_NEWGEN
digitalWrite(wifiIndicatorPin, LOW);
}
#endif
if(_mode == WIFI_AP){
DBG_PRINTF("Connected in AP_mode\n");
}else{
Expand Down