Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
546 B

  1. /*
  2. Part of MQTT and API modules
  3. */
  4. #if MQTT_SUPPORT || API_SUPPORT
  5. #include <Schedule.h>
  6. #include "system.h"
  7. #include "utils.h"
  8. #include "rpc.h"
  9. bool rpcHandleAction(const String& action) {
  10. bool result = false;
  11. if (action.equals("reboot")) {
  12. result = true;
  13. schedule_function([]() {
  14. deferredReset(100, CUSTOM_RESET_RPC);
  15. });
  16. } else if (action.equals("heartbeat")) {
  17. result = true;
  18. schedule_function(heartbeat);
  19. }
  20. return result;
  21. }
  22. #endif // MQTT_SUPPORT || API_SUPPORT