mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
commit
61464a408a
@ -50,30 +50,23 @@ void custom_loop()
|
|||||||
|
|
||||||
void custom_every_second()
|
void custom_every_second()
|
||||||
{
|
{
|
||||||
Serial.print("#");
|
// Unused
|
||||||
}
|
}
|
||||||
|
|
||||||
void custom_every_5seconds()
|
void custom_every_5seconds()
|
||||||
{
|
{
|
||||||
Log.verbose(TAG_CUSTOM, "5 seconds have passsed...");
|
// Unused
|
||||||
dispatch_state_subtopic("my_sensor", "{\"test\":123}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool custom_pin_in_use(uint pin)
|
bool custom_pin_in_use(uint pin)
|
||||||
{
|
{
|
||||||
if(pin == 1024) return true; // fictuous used pin
|
// no pins are used
|
||||||
|
|
||||||
// otherwise the pin is not used
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void custom_get_sensors(JsonDocument& doc)
|
void custom_get_sensors(JsonDocument& doc)
|
||||||
{
|
{
|
||||||
/* Sensor Name */
|
// Unused
|
||||||
JsonObject sensor = doc.createNestedObject(F("Custom"));
|
|
||||||
|
|
||||||
/* Key-Value pair of the sensor value */
|
|
||||||
sensor[F("Random")] = random(256);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Receive custom topic & payload messages */
|
/* Receive custom topic & payload messages */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user