mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-23 03:06:42 +00:00
Add HASP_USE_CUSTOM
This commit is contained in:
parent
3b377c8814
commit
0cb5588199
@ -35,7 +35,7 @@ bool custom_pin_in_use(uint pin)
|
||||
return false;
|
||||
}
|
||||
|
||||
void custom_get_sensors(JsonObject& doc)
|
||||
void custom_get_sensors(JsonDocument& doc)
|
||||
{
|
||||
/* Sensor Name */
|
||||
JsonObject sensor = doc.createNestedObject(F("Custom"));
|
||||
|
@ -22,8 +22,8 @@ void custom_every_5seconds();
|
||||
/* return true if the pin used by the custom code */
|
||||
bool custom_pin_in_use(uint pin);
|
||||
|
||||
/* Add a key which defines a JsonObject to add to the sensor JSON output */
|
||||
void custom_get_sensors(JsonObject& doc);
|
||||
/* Add a key which defines a JsonObject to add to the sensor JSON document */
|
||||
void custom_get_sensors(JsonDocument& doc);
|
||||
|
||||
#endif // HASP_USE_CUSTOM
|
||||
|
||||
|
@ -36,6 +36,10 @@
|
||||
#include "hasp_config.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_CUSTOM > 0
|
||||
#include "custom/my_custom.h"
|
||||
#endif
|
||||
|
||||
dispatch_conf_t dispatch_setings = {.teleperiod = 300};
|
||||
|
||||
uint16_t dispatchSecondsToNextTeleperiod = 0;
|
||||
@ -895,6 +899,10 @@ void dispatch_send_sensordata(const char*, const char*)
|
||||
|
||||
haspDevice.get_sensors(doc);
|
||||
|
||||
#if HASP_USE_CUSTOM > 0
|
||||
custom_get_sensors(doc);
|
||||
#endif
|
||||
|
||||
// JsonObject input = doc.createNestedObject(F("input"));
|
||||
// JsonArray relay = doc.createNestedArray(F("power"));
|
||||
// JsonArray led = doc.createNestedArray(F("light"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user