Skip to content

Commit

Permalink
IRMQTTServer: Add TX channel support for HTTP interface. (#929)
Browse files Browse the repository at this point in the history
* Allow "channel" (KEY_CHANNEL) argument to control which TX channel to send to.
* Update "aircon" html page to be able to selection which climate channel to use.
* Consolidate some duplicate code into `genStatTopic()`
* Update comments/documentation on for full multi-channel TX support.
* Fix some potential unreferenced pointer issues.
* Fix compile error when MQTT_CLIMATE_JSON is enabled.
* Fix compiler warning when DEBUG is disabled.
  • Loading branch information
crankyoldgit authored Sep 23, 2019
1 parent f987a62 commit 46f2946
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 119 deletions.
4 changes: 3 additions & 1 deletion examples/IRMQTTServer/IRMQTTServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ const uint16_t kMinUnknownSize = 2 * 10;
#define KEY_CODE "code"
#define KEY_BITS "bits"
#define KEY_REPEAT "repeats"
#define KEY_CHANNEL "channel" // Which IR TX channel to send on.

// GPIO html/config keys
#define KEY_TX_GPIO "tx"
Expand Down Expand Up @@ -236,7 +237,7 @@ const uint16_t kJsonAcStateMaxSize = 1024; // Bytes
// ----------------- End of User Configuration Section -------------------------

// Constants
#define _MY_VERSION_ "v1.4.3-beta"
#define _MY_VERSION_ "v1.4.4-alpha"

const uint8_t kRebootTime = 15; // Seconds
const uint8_t kQuickDisplayTime = 2; // Seconds
Expand Down Expand Up @@ -353,6 +354,7 @@ String gpioToString(const int16_t gpio);
uint8_t getDefaultIrSendIdx(void);
IRsend* getDefaultIrSendPtr(void);
int8_t getDefaultTxGpio(void);
String genStatTopic(const uint16_t channel = 0);
String listOfTxGpios(void);
bool hasUnsafeHTMLChars(String input);
String htmlHeader(const String title, const String h1_text = "");
Expand Down
Loading

0 comments on commit 46f2946

Please sign in to comment.