Move the HTTP server code to a new mode_pull module

This commit is contained in:
2021-01-29 11:01:07 +01:00
parent 932e3d5d52
commit 3d249d2e05
5 changed files with 298 additions and 102 deletions

31
mode_pull.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef __PWS_MODE_PULL_H
# define __PWS_MODE_PULL_H
# include "config.h"
class PWSModePull {
public:
PWSModePull(int port);
void begin();
void loop();
void sendValues(
#if defined(DHT_TYPE) || defined(HAVE_BMP180)
float temperature,
#endif
#ifdef DHT_TYPE
float humidity,
#endif
#ifdef RAIN_PIN
bool raining,
#endif
#ifdef HAVE_BH1750
float light,
#endif
#ifdef HAVE_BMP180
float pressure,
#endif
...);
private:
int _port;
};
#endif // __PWS_MODE_PULL_H