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