removed pgmem lib and added new NO_TX define

This commit is contained in:
proddy
2018-12-01 09:50:45 +01:00
parent 5e46bd9af1
commit 3b83d8f5f1

View File

@@ -17,7 +17,6 @@
// standard arduino libs // standard arduino libs
#include <Ticker.h> // https://github.com/esp8266/Arduino/tree/master/libraries/Ticker #include <Ticker.h> // https://github.com/esp8266/Arduino/tree/master/libraries/Ticker
#include <avr/pgmspace.h>
// these are set as -D build flags during compilation // these are set as -D build flags during compilation
//#define WIFI_SSID "<my_ssid>" //#define WIFI_SSID "<my_ssid>"
@@ -120,7 +119,7 @@ netInfo homeNet = {.mqttHost = MQTT_IP,
ESPHelper myESP(&homeNet); ESPHelper myESP(&homeNet);
command_t PROGMEM project_cmds[] = {{"s", "show statistics"}, command_t PROGMEM project_cmds[] = {{"s", "show statistics"},
{"h", "list supported EMS telegram types"}, {"h", "list supported EMS telegram type ids"},
{"P", "publish all stat to MQTT"}, {"P", "publish all stat to MQTT"},
{"v", "[n] set logging (0=none, 1=basic, 2=verbose)"}, {"v", "[n] set logging (0=none, 1=basic, 2=verbose)"},
{"p", "poll ems response on/off (default is off)"}, {"p", "poll ems response on/off (default is off)"},
@@ -567,7 +566,9 @@ void MQTTcallback(char * topic, byte * payload, uint8_t length) {
if (strcmp(topic, TOPIC_BOILER_WARM_WATER_SELECTED_TEMPERATURE) == 0) { if (strcmp(topic, TOPIC_BOILER_WARM_WATER_SELECTED_TEMPERATURE) == 0) {
uint8_t i = strtol((char *)payload, 0, 10); uint8_t i = strtol((char *)payload, 0, 10);
myDebug("MQTT topic: boiler_warm_water_selected_temperature value %d\n", i); myDebug("MQTT topic: boiler_warm_water_selected_temperature value %d\n", i);
#ifndef NO_TX
ems_setWarmWaterTemp(i); ems_setWarmWaterTemp(i);
#endif
// publish back so HA is immediately updated // publish back so HA is immediately updated
publishValues(); publishValues();
return; return;
@@ -685,9 +686,12 @@ void setup() {
#endif #endif
// Timers using Ticker library // Timers using Ticker library
publishValuesTimer.attach(PUBLISHVALUES_TIME, publishValues); // post HA values publishValuesTimer.attach(PUBLISHVALUES_TIME, publishValues); // post HA values
systemCheckTimer.attach(SYSTEMCHECK_TIME, systemCheck); // check if Boiler is online systemCheckTimer.attach(SYSTEMCHECK_TIME, systemCheck); // check if Boiler is online
#ifndef NO_TX
regularUpdatesTimer.attach((REGULARUPDATES_TIME / MAX_MANUAL_CALLS), regularUpdates); // regular reads from the EMS regularUpdatesTimer.attach((REGULARUPDATES_TIME / MAX_MANUAL_CALLS), regularUpdates); // regular reads from the EMS
#endif
// set up WiFi // set up WiFi
myESP.setWifiCallback(WIFIcallback); myESP.setWifiCallback(WIFIcallback);
@@ -818,6 +822,7 @@ void loop() {
myESP.publish(TOPIC_SHOWER_TIMER, Boiler_Status.shower_timer ? "1" : "0"); myESP.publish(TOPIC_SHOWER_TIMER, Boiler_Status.shower_timer ? "1" : "0");
myESP.publish(TOPIC_SHOWER_ALERT, Boiler_Status.shower_alert ? "1" : "0"); myESP.publish(TOPIC_SHOWER_ALERT, Boiler_Status.shower_alert ? "1" : "0");
#ifndef NO_TX
if (Boiler_Status.boiler_online) { if (Boiler_Status.boiler_online) {
// now that we're connected lets get some data from the EMS // now that we're connected lets get some data from the EMS
ems_doReadCommand(EMS_TYPE_UBAParameterWW); ems_doReadCommand(EMS_TYPE_UBAParameterWW);
@@ -825,6 +830,7 @@ void loop() {
} else { } else {
myDebugLog("Boot: can't connect to EMS."); myDebugLog("Boot: can't connect to EMS.");
} }
#endif
} }
// if we received new data and flagged for pushing, do it // if we received new data and flagged for pushing, do it