Skip to content

Commit

Permalink
MQTT spudning control issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vitotai committed May 24, 2023
1 parent e7307d5 commit 12ebe68
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 14 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[platformio]
#sonoff OTA no longer supported, classic interface no longer supported
default_envs = esp32-spiffs, esp8266, esp8266-tw, esp8266-spanish, esp8266-portuguese-br, esp8266-slovak, esp8266-oled, esp8266-ispindel, esp8266-it, esp8266-norwegian, thorrax, sonoff, sonoff-esp8285 , esp32, d1pro, sonoff-am2301
#default_envs = esp32
#default_envs = esp32-dev
#default_envs = esp8266-dev
#default_envs = esp8266

Expand Down
6 changes: 2 additions & 4 deletions src/BPLSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include "BPLSettings.h"
#include "BrewLogger.h"



BPLSettings theSettings;

#define BPLSettingFileName "/bpl.cfg"
Expand Down Expand Up @@ -1241,7 +1239,7 @@ String BPLSettings::jsonMqttRemoteControlSettings(void){
}
#endif

#if Auto_CAP
#if AUTO_CAP
if(settings->capControlPathOffset){
root[CapPathKey] = settings->_strings + settings->capControlPathOffset;
}
Expand Down Expand Up @@ -1355,7 +1353,7 @@ bool BPLSettings::dejsonMqttRemoteControlSettings(String json){
if(!(ptr=copyIfExist(root,PtcPathKey,settings->ptcPathOffset,ptr,base))) return false;
#endif

#if Auto_CAP
#if AUTO_CAP
if(!(ptr=copyIfExist(root,CapPathKey,settings->capControlPathOffset,ptr,base))) return false;
#endif

Expand Down
14 changes: 7 additions & 7 deletions src/MqttRemoteControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ extern BrewPiProxy brewpi;
#include "ParasiteTempController.h"
#endif

#if Auto_CAP
#include "AutoCapContro.h"
#if AUTO_CAP
#include "AutoCapControl.h"
#endif


Expand Down Expand Up @@ -265,7 +265,7 @@ void MqttRemoteControl::_loadConfig()
_ptcPath = settings->ptcPathOffset? (char*)settings->_strings + settings->ptcPathOffset:NULL;
#endif

#if Auto_CAP
#if AUTO_CAP
_capPath = settings->capControlPathOffset? (char*)settings->_strings + settings->capControlPathOffset:NULL;
#endif

Expand All @@ -280,7 +280,7 @@ void MqttRemoteControl::_loadConfig()
if(_ptcPath) DBG_PRINTF("_ptcPath:%s\n",_ptcPath);
#endif

#if Auto_CAP
#if AUTO_CAP
if(_capPath) DBG_PRINTF("_capPath:%s\n",_capPath);
#endif
#endif
Expand Down Expand Up @@ -349,7 +349,7 @@ void MqttRemoteControl::_onConnect(void){
}
#endif

#if Auto_CAP
#if AUTO_CAP
if(_capPath){
if(_client.subscribe(_capPath, 1)){
DBG_PRINTF("MQTT:Subscribing %s\n",_capPath);
Expand Down Expand Up @@ -382,7 +382,7 @@ void MqttRemoteControl::_onMessage(char* topic, uint8_t* payload, size_t len) {
this->_onPtcChange((char*)payload,len);
}
#endif
#if Auto_CAP
#if AUTO_CAP
else if(strcmp(topic, _capPath) ==0){
this->_onCapChange((char*)payload,len);
}
Expand Down Expand Up @@ -464,7 +464,7 @@ void MqttRemoteControl::_onPtcChange(char* payload, size_t len){
#endif


#if Auto_CAP
#if AUTO_CAP
void MqttRemoteControl::_onCapChange(char* payload,size_t len){
bool mode;

Expand Down
4 changes: 2 additions & 2 deletions src/MqttRemoteControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MqttRemoteControl{
char* _ptcPath;
#endif

#if Auto_CAP
#if AUTO_CAP
char* _capPath;
#endif

Expand All @@ -81,7 +81,7 @@ class MqttRemoteControl{
void _onPtcChange(char* payload,size_t len);
#endif

#if Auto_CAP
#if AUTO_CAP
void _onCapChange(char* payload,size_t len);
#endif
void _loadConfig();
Expand Down

0 comments on commit 12ebe68

Please sign in to comment.