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.

27 lines
564 B

  1. /*
  2. Part of MQTT and API modules
  3. */
  4. #pragma once
  5. #include "espurna.h"
  6. #include "broker.h"
  7. BrokerDeclare(StatusBroker, void(const String& topic, unsigned char id, unsigned int status));
  8. // --------------------------------------------------------------------------
  9. enum class PayloadStatus {
  10. Off = 0,
  11. On = 1,
  12. Toggle = 2,
  13. Unknown = 0xFF
  14. };
  15. using rpc_payload_check_t = PayloadStatus(*)(const char*);
  16. bool rpcHandleAction(const String& action);
  17. PayloadStatus rpcParsePayload(const char* payload, const rpc_payload_check_t ext_check = nullptr);