fix for capacitive sensors not working, enum introduction for sensormode

This commit is contained in:
c3ma
2022-02-19 02:24:19 +01:00
parent d0320beaa7
commit a0f8df7016
6 changed files with 192 additions and 177 deletions
+15 -3
View File
@@ -13,9 +13,21 @@
#include <Homie.h>
#define SENSOR_NONE 0
#define SENSOR_CAPACITIVE_FREQUENCY_MOD 1
#define SENSOR_ANALOG_RESISTANCE_PROBE 2
#define FOREACH_SENSOR(SENSOR) \
SENSOR(NONE) \
SENSOR(CAPACITIVE_FREQUENCY) \
SENSOR(ANALOG_RESISTANCE_PROBE) \
#define GENERATE_ENUM(ENUM) ENUM,
#define GENERATE_STRING(STRING) #STRING,
enum SENSOR_MODE {
FOREACH_SENSOR(GENERATE_ENUM)
};
static const char *SENSOR_STRING[] = {
FOREACH_SENSOR(GENERATE_STRING)
};
//plant pump is deactivated, but sensor values are still recorded and published
#define DEACTIVATED_PLANT -1