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.

43 lines
944 B

  1. /*
  2. RELAY MODULE
  3. Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. #pragma once
  6. #include "espurna.h"
  7. #include "rpc.h"
  8. #include <bitset>
  9. constexpr size_t RELAYS_MAX = 32;
  10. PayloadStatus relayParsePayload(const char * payload);
  11. bool relayStatus(unsigned char id, bool status, bool report, bool group_report);
  12. bool relayStatus(unsigned char id, bool status);
  13. bool relayStatus(unsigned char id);
  14. void relayToggle(unsigned char id, bool report, bool group_report);
  15. void relayToggle(unsigned char id);
  16. unsigned char relayCount();
  17. const String& relayPayloadOn();
  18. const String& relayPayloadOff();
  19. const String& relayPayloadToggle();
  20. const char* relayPayload(PayloadStatus status);
  21. void relayMQTT(unsigned char id);
  22. void relayMQTT();
  23. void relayPulse(unsigned char id);
  24. void relaySync(unsigned char id);
  25. void relaySave(bool eeprom);
  26. void relaySetupDummy(size_t size, bool reconfigure = false);
  27. void relaySetup();