-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathTemperatureService.h
37 lines (30 loc) · 943 Bytes
/
TemperatureService.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef TemperatureService_h
#define TemperatureService_h
#include <OneWire.h>
#include <DallasTemperature.h>
#include <TimeLib.h>
#include <ESPAsyncWebServer.h>
#include <ActiveStatus.h>
#include <BrewSettingsService.h>
#include <enum.h>
#define APPLICATION_JSON_TYPE "application/json"
#define GET_SENSORS_SERVICE_PATH "/rest/getsensors"
class TemperatureService
{
public:
TemperatureService(AsyncWebServer *server, FS *fs, DallasTemperature dallasTemperature, BrewSettingsService *brewSettingsService);
~TemperatureService();
BrewSettingsService *_brewSettingsService;
Temperatures GetTemperatures();
void GetTemperatureAndAdress(AsyncWebServerRequest *request);
String GetAddressToString(DeviceAddress deviceAddress);
String GetSensorsJson();
String GetFirstSensorAddress();
int DeviceCount;
private:
DallasTemperature _dallasTemperature;
AsyncWebServer *_server;
FS *_fs;
float getTemperature();
};
#endif