Skip to content

Commit

Permalink
[Bug] IRMQTTServer: Compiler error under PlatformIO on Windows. (#1354)
Browse files Browse the repository at this point in the history
* Moved `htmlOptionItem` before `htmlSelectAcStateProtocol`
* Add a `htmlOptionItem` proto to `IRMQTTServer.h`

Co-authored-by: David Conran <[email protected]>

Fixes #1353
  • Loading branch information
bwint authored Dec 4, 2020
1 parent 5a9ad8a commit 918f793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions examples/IRMQTTServer/IRMQTTServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ void handleRoot(void);
String addJsReloadUrl(const String url, const uint16_t timeout_s,
const bool notify);
void handleExamples(void);
String htmlOptionItem(const String value, const String text, bool selected);
String htmlSelectBool(const String name, const bool def);
String htmlSelectClimateProtocol(const String name, const decode_type_t def);
String htmlSelectAcStateProtocol(const String name, const decode_type_t def,
Expand Down
16 changes: 8 additions & 8 deletions examples/IRMQTTServer/IRMQTTServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,14 @@ String htmlMenu(void) {
return html;
}

String htmlOptionItem(const String value, const String text, bool selected) {
String html = F("<option value='");
html += value + '\'';
if (selected) html += F(" selected='selected'");
html += '>' + text + F("</option>");
return html;
}

String htmlSelectAcStateProtocol(const String name, const decode_type_t def,
const bool simple) {
String html = "<select name='" + name + "'>";
Expand Down Expand Up @@ -885,14 +893,6 @@ void handleExamples(void) {
}
#endif // EXAMPLES_ENABLE

String htmlOptionItem(const String value, const String text, bool selected) {
String html = F("<option value='");
html += value + '\'';
if (selected) html += F(" selected='selected'");
html += '>' + text + F("</option>");
return html;
}

String htmlSelectBool(const String name, const bool def) {
String html = "<select name='" + name + "'>";
for (uint16_t i = 0; i < 2; i++)
Expand Down

0 comments on commit 918f793

Please sign in to comment.