1
0

Refactor: update DEVICE_ROLE to ACTUATOR and adjust sensor serialization logic

This commit is contained in:
Jose
2025-06-04 00:21:38 +02:00
parent e30531729a
commit 97a17b926d
3 changed files with 5 additions and 1 deletions

View File

@@ -11,6 +11,7 @@
#include "MAX7219.hpp"
#endif
#if DEVICE_ROLE == SENSOR
String serializeSensorValue(
int groupId,
const String &deviceId,
@@ -20,6 +21,7 @@ String serializeSensorValue(
const BME280Data_t &bme,
const MQ7Data_t &mq7,
const GPSData_t &gps);
#endif
#if DEVICE_ROLE == ACTUATOR
MAX7219Status_t deserializeActuatorStatus(HTTPClient &http, int httpResponseCode);

View File

@@ -2,7 +2,7 @@
#include <Arduino.h>
#define DEVICE_ROLE SENSOR // se cambia entre SENSOR y ACTUATOR
#define DEVICE_ROLE ACTUATOR // se cambia entre SENSOR y ACTUATOR
#define MQTT_URI "miarma.net"
#define API_URI "https://contaminus.miarma.net/api/v1/"

View File

@@ -1,5 +1,6 @@
#include "JsonTools.hpp"
#if DEVICE_ROLE == SENSOR
String serializeSensorValue(
int groupId,
const String &deviceId,
@@ -39,6 +40,7 @@ String serializeSensorValue(
#endif
return output;
}
#endif
#if DEVICE_ROLE == ACTUATOR
MAX7219Status_t deserializeActuatorStatus(HTTPClient &http, int httpResponseCode)