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.

38 lines
824 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. constexpr size_t RELAYS_MAX = 32;
  7. enum class RelayStatus : unsigned char {
  8. OFF = 0,
  9. ON = 1,
  10. TOGGLE = 2,
  11. UNKNOWN = 0xFF
  12. };
  13. RelayStatus relayParsePayload(const char * payload);
  14. bool relayStatus(unsigned char id, bool status, bool report, bool group_report);
  15. bool relayStatus(unsigned char id, bool status);
  16. bool relayStatus(unsigned char id);
  17. void relayToggle(unsigned char id, bool report, bool group_report);
  18. void relayToggle(unsigned char id);
  19. unsigned char relayCount();
  20. const String& relayPayloadOn();
  21. const String& relayPayloadOff();
  22. const String& relayPayloadToggle();
  23. const char* relayPayload(RelayStatus status);
  24. void relaySetupDummy(unsigned char size, bool reconfigure = false);