Merge pull request #8284 from s-hadinger/ir_276
Change IRremoteESP8266 library updated to v2.7.6
|
@ -1,46 +0,0 @@
|
|||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
; Default platform
|
||||
platform = espressif8266
|
||||
; Default board
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
board = nodemcuv2
|
||||
; build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
; build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:de-CH]
|
||||
build_flags = -D_IR_LOCALE_=de-CH
|
||||
|
||||
[env:de-DE]
|
||||
build_flags = -D_IR_LOCALE_=de-DE
|
||||
|
||||
[env:en-AU]
|
||||
build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:en-IE]
|
||||
build_flags = -D_IR_LOCALE_=en-IE
|
||||
|
||||
[env:en-UK]
|
||||
build_flags = -D_IR_LOCALE_=en-UK
|
||||
|
||||
[env:en-US]
|
||||
build_flags = -D_IR_LOCALE_=en-US
|
||||
|
||||
[env:es-ES]
|
||||
build_flags = -D_IR_LOCALE_=es-ES
|
||||
|
||||
[env:fr-FR]
|
||||
build_flags = -D_IR_LOCALE_=fr-FR
|
|
@ -9,8 +9,8 @@
|
|||
This library enables you to **send _and_ receive** infra-red signals on an [ESP8266](https://github.com/esp8266/Arduino) or an
|
||||
[ESP32](https://github.com/espressif/arduino-esp32) using the [Arduino framework](https://www.arduino.cc/) using common 940nm IR LEDs and common IR receiver modules. e.g. TSOP{17,22,24,36,38,44,48}* demodulators etc.
|
||||
|
||||
## v2.7.5 Now Available
|
||||
Version 2.7.5 of the library is now [available](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes.
|
||||
## v2.7.6 Now Available
|
||||
Version 2.7.6 of the library is now [available](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). You can view the [Release Notes](ReleaseNotes.md) for all the significant changes.
|
||||
|
||||
#### Upgrading from pre-v2.0
|
||||
Usage of the library has been slightly changed in v2.0. You will need to change your usage to work with v2.0 and beyond. You can read more about the changes required on our [Upgrade to v2.0](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Upgrading-to-v2.0) page.
|
|
@ -9,8 +9,8 @@
|
|||
Cette librairie vous permetra de **recevoir et d'envoyer des signaux** infrarouge sur le protocole [ESP8266](https://github.com/esp8266/Arduino) ou sur le protocole
|
||||
[ESP32](https://github.com/espressif/arduino-esp32) en utilisant le [Arduino framework](https://www.arduino.cc/) qui utilise la norme 940nm IR LEDs et le module basique de reception d'onde IR. Exemple : TSOP{17,22,24,36,38,44,48}* modules etc.
|
||||
|
||||
## v2.7.5 disponible
|
||||
Version 2.7.5 de la libraire est maintenant [disponible](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Vous pouvez voir le [Release Notes](ReleaseNotes.md) pour tous les changements importants.
|
||||
## v2.7.6 disponible
|
||||
Version 2.7.6 de la libraire est maintenant [disponible](https://github.com/crankyoldgit/IRremoteESP8266/releases/latest). Vous pouvez voir le [Release Notes](ReleaseNotes.md) pour tous les changements importants.
|
||||
|
||||
#### mise à jour depuis pre-v2.0
|
||||
L'utilisation de la librairie à un peu changer depuis la version in v2.0. Si vous voulez l'utiliser vous devrez changer votre utilisation aussi. Vous pouvez vous renseigner sur les précondition d'utilisation ici : [Upgrade to v2.0](https://github.com/crankyoldgit/IRremoteESP8266/wiki/Upgrading-to-v2.0) page.
|
|
@ -1,5 +1,17 @@
|
|||
# Release Notes
|
||||
|
||||
## _v2.7.6 (20200425)_
|
||||
|
||||
**[Features]**
|
||||
- IRMQTTServer: Use more i18n text. (#1086)
|
||||
- Convert Protocol names to shared text. Saves ~3k of flash. (#1078)
|
||||
- Add Chinese translation (zh-CN) & add utf-8 support. (#1080, #1085)
|
||||
|
||||
**[Misc]**
|
||||
- IRMQTTServer: Ensure MQTT_MAX_PACKET_SIZE is correctly set. (#1084)
|
||||
- Add Italian locale to IRrecvDumpV2 platformio file.
|
||||
|
||||
|
||||
## _v2.7.5 (20200409)_
|
||||
|
||||
**[Features]**
|
|
@ -239,7 +239,7 @@ const uint16_t kJsonAcStateMaxSize = 1024; // Bytes
|
|||
// ----------------- End of User Configuration Section -------------------------
|
||||
|
||||
// Constants
|
||||
#define _MY_VERSION_ "v1.4.7"
|
||||
#define _MY_VERSION_ "v1.4.9"
|
||||
|
||||
const uint8_t kRebootTime = 15; // Seconds
|
||||
const uint8_t kQuickDisplayTime = 2; // Seconds
|
|
@ -358,12 +358,17 @@
|
|||
#include <IRutils.h>
|
||||
#include <IRac.h>
|
||||
#if MQTT_ENABLE
|
||||
#include <PubSubClient.h>
|
||||
// --------------------------------------------------------------------
|
||||
// * * * IMPORTANT * * *
|
||||
// You must change <PubSubClient.h> to have the following value.
|
||||
// #define MQTT_MAX_PACKET_SIZE 768
|
||||
// --------------------------------------------------------------------
|
||||
#include <PubSubClient.h>
|
||||
// Check that the user has set MQTT_MAX_PACKET_SIZE to an appropriate size.
|
||||
#if MQTT_MAX_PACKET_SIZE < 768
|
||||
#error "MQTT_MAX_PACKET_SIZE in <PubSubClient.h> is too small. "\
|
||||
"Increase the value per comments."
|
||||
#endif // MQTT_MAX_PACKET_SIZE < 768
|
||||
#endif // MQTT_ENABLE
|
||||
#include <algorithm> // NOLINT(build/include)
|
||||
#include <memory>
|
||||
|
@ -622,7 +627,7 @@ bool loadConfigFile(void) {
|
|||
|
||||
String timeElapsed(uint32_t const msec) {
|
||||
String result = msToString(msec);
|
||||
if (result.equalsIgnoreCase("Now"))
|
||||
if (result.equalsIgnoreCase(D_STR_NOW))
|
||||
return result;
|
||||
else
|
||||
return result + F(" ago");
|
||||
|
@ -642,7 +647,7 @@ String timeSince(uint32_t const start) {
|
|||
|
||||
String gpioToString(const int16_t gpio) {
|
||||
if (gpio == kGpioUnused)
|
||||
return F("Unused");
|
||||
return F(D_STR_UNUSED);
|
||||
else
|
||||
return String(gpio);
|
||||
}
|
||||
|
@ -715,13 +720,13 @@ void handleRoot(void) {
|
|||
html += F(
|
||||
"<h3>Send a simple IR message</h3><p>"
|
||||
"<form method='POST' action='/ir' enctype='multipart/form-data'>"
|
||||
"Type: ");
|
||||
D_STR_PROTOCOL ": ");
|
||||
html += htmlSelectAcStateProtocol(KEY_TYPE, decode_type_t::NEC, true);
|
||||
html += F(
|
||||
" Code: 0x<input type='text' name='code' min='0' value='0' size='16'"
|
||||
" maxlength='16'>"
|
||||
" Bit size: "
|
||||
"<select name='bits'>"
|
||||
" " D_STR_CODE ": 0x<input type='text' name='" KEY_CODE "' min='0' "
|
||||
"value='0' size='16' maxlength='16'> "
|
||||
D_STR_BITS ": "
|
||||
"<select name='" KEY_BITS "'>"
|
||||
"<option selected='selected' value='0'>Default</option>"); // Default
|
||||
for (uint8_t i = 0; i < sizeof(kCommonBitSizes); i++) {
|
||||
String num = String(kCommonBitSizes[i]);
|
||||
|
@ -733,18 +738,18 @@ void handleRoot(void) {
|
|||
}
|
||||
html += F(
|
||||
"</select>"
|
||||
" Repeats: <input type='number' name='repeats' min='0' max='99' value='0'"
|
||||
"size='2' maxlength='2'>"
|
||||
" <input type='submit' value='Send IR'>"
|
||||
" " D_STR_REPEAT ": <input type='number' name='" KEY_REPEAT "' min='0' "
|
||||
"max='99' value='0' size='2' maxlength='2'>"
|
||||
" <input type='submit' value='Send " D_STR_CODE "'>"
|
||||
"</form>"
|
||||
"<br><hr>"
|
||||
"<h3>Send a complex (Air Conditioner) IR message</h3><p>"
|
||||
"<form method='POST' action='/ir' enctype='multipart/form-data'>"
|
||||
"Type: ");
|
||||
D_STR_PROTOCOL ": ");
|
||||
html += htmlSelectAcStateProtocol(KEY_TYPE, decode_type_t::KELVINATOR, false);
|
||||
html += F(
|
||||
" State code: 0x"
|
||||
"<input type='text' name='code' size='");
|
||||
" State " D_STR_CODE ": 0x"
|
||||
"<input type='text' name='" KEY_CODE "' size='");
|
||||
html += String(kStateSizeMax * 2);
|
||||
html += F("' maxlength='");
|
||||
html += String(kStateSizeMax * 2);
|
||||
|
@ -754,14 +759,14 @@ void handleRoot(void) {
|
|||
"190B8050000000E0190B8070000010F0"
|
||||
#endif // EXAMPLES_ENABLE
|
||||
"'>"
|
||||
" <input type='submit' value='Send A/C State'>"
|
||||
" <input type='submit' value='Send A/C " D_STR_CODE "'>"
|
||||
"</form>"
|
||||
"<br><hr>"
|
||||
"<h3>Send an IRremote Raw IR message</h3><p>"
|
||||
"<form method='POST' action='/ir' enctype='multipart/form-data'>"
|
||||
"<input type='hidden' name='type' value='30'>"
|
||||
"String: (freq,array data) <input type='text' name='code' size='132'"
|
||||
" value='"
|
||||
"<input type='hidden' name='" KEY_TYPE "' value='30'>"
|
||||
"String: (freq,array data) <input type='text' name='" KEY_CODE "'"
|
||||
" size='132' value='"
|
||||
#if EXAMPLES_ENABLE
|
||||
"38000,4420,4420,520,1638,520,1638,520,1638,520,520,520,520,520,"
|
||||
"520,520,520,520,520,520,1638,520,1638,520,1638,520,520,520,"
|
||||
|
@ -776,8 +781,8 @@ void handleRoot(void) {
|
|||
"<h3>Send a <a href='https://irdb.globalcache.com/'>GlobalCache</a>"
|
||||
" IR message</h3><p>"
|
||||
"<form method='POST' action='/ir' enctype='multipart/form-data'>"
|
||||
"<input type='hidden' name='type' value='31'>"
|
||||
"String: 1:1,1,<input type='text' name='code' size='132'"
|
||||
"<input type='hidden' name='" KEY_TYPE "' value='31'>"
|
||||
"String: 1:1,1,<input type='text' name='" KEY_CODE "' size='132'"
|
||||
" value='"
|
||||
#if EXAMPLES_ENABLE
|
||||
"38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,"
|
||||
|
@ -792,9 +797,9 @@ void handleRoot(void) {
|
|||
"<h3>Send a <a href='http://www.remotecentral.com/cgi-bin/files/rcfiles.cgi"
|
||||
"?area=pronto&db=discrete'>Pronto code</a> IR message</h3><p>"
|
||||
"<form method='POST' action='/ir' enctype='multipart/form-data'>"
|
||||
"<input type='hidden' name='type' value='25'>"
|
||||
"String (comma separated): <input type='text' name='code' size='132'"
|
||||
" value='"
|
||||
"<input type='hidden' name='" KEY_TYPE "' value='25'>"
|
||||
"String (comma separated): <input type='text' name='" KEY_CODE "'"
|
||||
" size='132' value='"
|
||||
#if EXAMPLES_ENABLE
|
||||
"0000,0067,0000,0015,0060,0018,0018,0018,0030,0018,0030,0018,"
|
||||
"0030,0018,0018,0018,0030,0018,0018,0018,0018,0018,0030,0018,0018,"
|
||||
|
@ -802,8 +807,8 @@ void handleRoot(void) {
|
|||
"0018,0018,0018,0018,0030,0018,0018,03f6"
|
||||
#endif // EXAMPLES_ENABLE
|
||||
"'>"
|
||||
" Repeats: <input type='number' name='repeats' min='0' max='99' value='0'"
|
||||
"size='2' maxlength='2'>"
|
||||
" " D_STR_REPEAT ": <input type='number' name='" KEY_REPEAT "' min='0' "
|
||||
"max='99' value='0' size='2' maxlength='2'>"
|
||||
" <input type='submit' value='Send Pronto'>"
|
||||
"</form>"
|
||||
"<br>");
|
||||
|
@ -825,7 +830,7 @@ String addJsReloadUrl(const String url, const uint16_t timeout_s,
|
|||
if (notify && timeout_s) {
|
||||
html += F(" document.write(\"You will be redirected to the main page in ");
|
||||
html += String(timeout_s);
|
||||
html += F(" seconds.\");\n");
|
||||
html += F(" " D_STR_SECONDS ".\");\n");
|
||||
}
|
||||
html += F(" setTimeout('Redirect()', ");
|
||||
html += String(timeout_s * 1000); // Convert to mSecs
|
||||
|
@ -848,35 +853,44 @@ void handleExamples(void) {
|
|||
html += htmlMenu();
|
||||
html += F(
|
||||
"<h3>Hardcoded examples</h3>"
|
||||
"<p><a href=\"ir?code=38000,1,69,341,171,21,64,21,64,21,21,21,21,21,21,21,"
|
||||
"21,21,21,21,64,21,64,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,64,"
|
||||
"21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,64,21,64,21,"
|
||||
"21,21,64,21,64,21,64,21,1600,341,85,21,3647&type=31\">"
|
||||
"Sherwood Amp On (GlobalCache)</a></p>"
|
||||
"<p><a href=\"ir?code=38000,8840,4446,546,1664,546,1664,546,546,546,546,"
|
||||
"546,546,546,546,546,546,546,1664,546,1664,546,546,546,1664,546,546,"
|
||||
"546,546,546,546,546,1664,546,546,546,1664,546,546,546,1664,546,1664,"
|
||||
"546,1664,546,546,546,546,546,546,546,546,546,1664,546,546,546,546,546,"
|
||||
"546,546,1664,546,1664,546,1664,546,41600,8840,2210,546&type=30\">"
|
||||
"Sherwood Amp Off (Raw)</a></p>"
|
||||
"<p><a href=\"ir?code=0000,006E,0022,0002,0155,00AA,0015,0040,0015,0040"
|
||||
",0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0040,0015,0040"
|
||||
",0015,0015,0015,0040,0015,0015,0015,0015,0015,0015,0015,0040,0015,0015"
|
||||
",0015,0015,0015,0040,0015,0040,0015,0015,0015,0015,0015,0015,0015,0015"
|
||||
",0015,0015,0015,0040,0015,0015,0015,0015,0015,0040,0015,0040,0015,0040"
|
||||
",0015,0040,0015,0040,0015,0640,0155,0055,0015,0E40"
|
||||
"&type=25&repeats=1\">"
|
||||
"<p><a href=\"ir?" KEY_CODE "=38000,1,69,341,171,21,64,21,64,21,21,21,21,"
|
||||
"21,21,21,21,21,21,21,64,21,64,21,21,21,64,21,21,21,21,21,21,21,64,21,"
|
||||
"21,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,64,"
|
||||
"21,64,21,21,21,64,21,64,21,64,21,1600,341,85,21,3647"
|
||||
"&" KEY_TYPE "=31\">Sherwood Amp " D_STR_ON " (GlobalCache)</a></p>"
|
||||
"<p><a href=\"ir?" KEY_CODE "=38000,8840,4446,546,1664,546,1664,546,546,"
|
||||
"546,546,546,546,546,546,546,546,546,1664,546,1664,546,546,546,1664,"
|
||||
"546,546,546,546,546,546,546,1664,546,546,546,1664,546,546,546,1664,"
|
||||
"546,1664,546,1664,546,546,546,546,546,546,546,546,546,1664,546,546,"
|
||||
"546,546,546,546,546,1664,546,1664,546,1664,546,41600,8840,2210,546"
|
||||
"&" KEY_TYPE "=30\">Sherwood Amp " D_STR_OFF " (Raw)</a></p>"
|
||||
"<p><a href=\"ir?" KEY_CODE "=0000,006E,0022,0002,0155,00AA,0015,0040,0015,"
|
||||
"0040,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0040,0015,"
|
||||
"0040,0015,0015,0015,0040,0015,0015,0015,0015,0015,0015,0015,0040,0015,"
|
||||
"0015,0015,0015,0015,0040,0015,0040,0015,0015,0015,0015,0015,0015,0015,"
|
||||
"0015,0015,0015,0015,0040,0015,0015,0015,0015,0015,0040,0015,0040,0015,"
|
||||
"0040,0015,0040,0015,0040,0015,0640,0155,0055,0015,0E40"
|
||||
"&" KEY_TYPE "=25&" KEY_REPEAT "=1\">"
|
||||
"Sherwood Amp Input TAPE (Pronto)</a></p>"
|
||||
"<p><a href=\"ir?type=7&code=E0E09966\">TV on (Samsung)</a></p>"
|
||||
"<p><a href=\"ir?type=4&code=0xf50&bits=12\">Power Off (Sony 12bit)</a></p>"
|
||||
"<p><a href=\"aircon/set?protocol=PANASONIC_AC&model=LKE&power=on&"
|
||||
"mode=auto&fanspeed=min&temp=23\">"
|
||||
"Panasonic A/C LKE model, On, Auto mode, Min fan, 23C"
|
||||
"<p><a href=\"ir?" KEY_TYPE "=7&" KEY_CODE "=E0E09966\">TV " D_STR_ON
|
||||
" (Samsung)</a></p>"
|
||||
"<p><a href=\"ir?" KEY_TYPE "=4&" KEY_CODE "=0xf50&bits=12\">" D_STR_POWER
|
||||
" " D_STR_OFF " (Sony 12 " D_STR_BITS ")</a></p>"
|
||||
"<p><a href=\"aircon/set?protocol=PANASONIC_AC&"
|
||||
KEY_MODEL "=LKE&"
|
||||
KEY_POWER "=on&"
|
||||
KEY_MODE "=auto&"
|
||||
KEY_FANSPEED "=min&"
|
||||
KEY_TEMP "=23\">"
|
||||
"Panasonic A/C " D_STR_MODEL " LKE, " D_STR_ON ", " D_STR_AUTO " "
|
||||
D_STR_MODE ", " D_STR_MIN " " D_STR_FAN ", 23C"
|
||||
" <i>(via HTTP aircon interface)</i></a></p>"
|
||||
"<p><a href=\"aircon/set?temp=27\">"
|
||||
"Change just the temp to 27C <i>(via HTTP aircon interface)</i></a></p>"
|
||||
"<p><a href=\"aircon/set?power=off&mode=off\">"
|
||||
"Turn OFF the current A/C <i>(via HTTP aircon interface)</i></a></p>"
|
||||
"<p><a href=\"aircon/set?" KEY_TEMP "=27\">"
|
||||
"Change just the " D_STR_TEMP " to 27C <i>"
|
||||
"(via HTTP aircon interface)</i></a></p>"
|
||||
"<p><a href=\"aircon/set?" KEY_POWER "=off&" KEY_MODE "=off\">"
|
||||
"Turn " D_STR_OFF " the current A/C <i>("
|
||||
"via HTTP aircon interface)</i></a></p>"
|
||||
"<br><hr>");
|
||||
html += htmlEnd();
|
||||
server.send(200, "text/html", html);
|
||||
|
@ -996,7 +1010,9 @@ String htmlSelectSwingh(const String name, const stdAc::swingh_t def) {
|
|||
String htmlHeader(const String title, const String h1_text) {
|
||||
String html = F("<html><head><title>");
|
||||
html += title;
|
||||
html += F("</title></head><body><center><h1>");
|
||||
html += F("</title><meta http-equiv=\"Content-Type\" "
|
||||
"content=\"text/html;charset=utf-8\">"
|
||||
"</head><body><center><h1>");
|
||||
if (h1_text.length())
|
||||
html += h1_text;
|
||||
else
|
||||
|
@ -1042,20 +1058,20 @@ void handleAirCon(void) {
|
|||
"<input type='hidden' name='" KEY_CHANNEL "' value='" + String(chan) +
|
||||
"'>" +
|
||||
"<table style='width:33%'>"
|
||||
"<tr><td>Protocol</td><td>" +
|
||||
"<tr><td>" D_STR_PROTOCOL "</td><td>" +
|
||||
htmlSelectClimateProtocol(KEY_PROTOCOL,
|
||||
climate[chan]->next.protocol) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Model</td><td>" +
|
||||
"<tr><td>" D_STR_MODEL "</td><td>" +
|
||||
htmlSelectModel(KEY_MODEL, climate[chan]->next.model) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Power</td><td>" +
|
||||
"<tr><td>" D_STR_POWER "</td><td>" +
|
||||
htmlSelectBool(KEY_POWER, climate[chan]->next.power) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Mode</td><td>" +
|
||||
"<tr><td>" D_STR_MODE "</td><td>" +
|
||||
htmlSelectMode(KEY_MODE, climate[chan]->next.mode) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Temp</td><td>"
|
||||
"<tr><td>" D_STR_TEMP "</td><td>"
|
||||
"<input type='number' name='" KEY_TEMP "' min='16' max='90' "
|
||||
"step='0.5' value='" + String(climate[chan]->next.degrees, 1) + "'>"
|
||||
"<select name='" KEY_CELSIUS "'>"
|
||||
|
@ -1066,34 +1082,34 @@ void handleAirCon(void) {
|
|||
(!climate[chan]->next.celsius ? " selected='selected'" : "") +
|
||||
">F</option>"
|
||||
"</select></td></tr>"
|
||||
"<tr><td>Fan Speed</td><td>" +
|
||||
"<tr><td>" D_STR_FAN "</td><td>" +
|
||||
htmlSelectFanspeed(KEY_FANSPEED, climate[chan]->next.fanspeed) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Swing (V)</td><td>" +
|
||||
"<tr><td>" D_STR_SWINGV "</td><td>" +
|
||||
htmlSelectSwingv(KEY_SWINGV, climate[chan]->next.swingv) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Swing (H)</td><td>" +
|
||||
"<tr><td>" D_STR_SWINGH "</td><td>" +
|
||||
htmlSelectSwingh(KEY_SWINGH, climate[chan]->next.swingh) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Quiet</td><td>" +
|
||||
"<tr><td>" D_STR_QUIET "</td><td>" +
|
||||
htmlSelectBool(KEY_QUIET, climate[chan]->next.quiet) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Turbo</td><td>" +
|
||||
"<tr><td>" D_STR_TURBO "</td><td>" +
|
||||
htmlSelectBool(KEY_TURBO, climate[chan]->next.turbo) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Econo</td><td>" +
|
||||
"<tr><td>" D_STR_ECONO "</td><td>" +
|
||||
htmlSelectBool(KEY_ECONO, climate[chan]->next.econo) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Light</td><td>" +
|
||||
"<tr><td>" D_STR_LIGHT "</td><td>" +
|
||||
htmlSelectBool(KEY_LIGHT, climate[chan]->next.light) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Filter</td><td>" +
|
||||
"<tr><td>" D_STR_FILTER "</td><td>" +
|
||||
htmlSelectBool(KEY_FILTER, climate[chan]->next.filter) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Clean</td><td>" +
|
||||
"<tr><td>" D_STR_CLEAN "</td><td>" +
|
||||
htmlSelectBool(KEY_CLEAN, climate[chan]->next.clean) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Beep</td><td>" +
|
||||
"<tr><td>" D_STR_BEEP "</td><td>" +
|
||||
htmlSelectBool(KEY_BEEP, climate[chan]->next.beep) +
|
||||
"</td></tr>"
|
||||
"<tr><td>Force resend</td><td>" +
|
||||
|
@ -1260,9 +1276,9 @@ void handleInfo(void) {
|
|||
"Last IR Received: " + lastIrReceived +
|
||||
" <i>(" + timeSince(lastIrReceivedTime) + ")</i><br>"
|
||||
#endif // IR_RX
|
||||
"Duplicate Wifi networks: " +
|
||||
"Duplicate " D_STR_WIFI " networks: " +
|
||||
String(HIDE_DUPLICATE_NETWORKS ? "Hide" : "Show") + "<br>"
|
||||
"Min Wifi signal required: "
|
||||
"Min " D_STR_WIFI " signal required: "
|
||||
#ifdef MIN_SIGNAL_STRENGTH
|
||||
+ String(static_cast<int>(MIN_SIGNAL_STRENGTH)) +
|
||||
#else // MIN_SIGNAL_STRENGTH
|
||||
|
@ -1271,9 +1287,9 @@ void handleInfo(void) {
|
|||
"%<br>"
|
||||
"Serial debugging: "
|
||||
#if DEBUG
|
||||
+ String(isSerialGpioUsedByIr() ? "Off" : "On") +
|
||||
+ String(isSerialGpioUsedByIr() ? D_STR_OFF : D_STR_ON) +
|
||||
#else // DEBUG
|
||||
"Off"
|
||||
D_STR_OFF
|
||||
#endif // DEBUG
|
||||
"<br>"
|
||||
#if REPORT_VCC
|
||||
|
@ -1289,6 +1305,7 @@ void handleInfo(void) {
|
|||
: "Disconnected " + timeSince(lastConnectedTime)) +
|
||||
")</i><br>"
|
||||
"Disconnections: " + String(mqttDisconnectCounter - 1) + "<br>"
|
||||
"Max Packet Size: " + MQTT_MAX_PACKET_SIZE + " bytes<br>"
|
||||
"Client id: " + MqttClientId + "<br>"
|
||||
"Command topic(s): " + listOfCommandTopics() + "<br>"
|
||||
"Acknowledgements topic: " + MqttAck + "<br>"
|
||||
|
@ -1330,6 +1347,7 @@ void handleInfo(void) {
|
|||
timeElapsed(lastDiscovery.elapsed()) :
|
||||
String("<i>Never</i>"))) +
|
||||
"<br>"
|
||||
"Discovery topic: " + MqttDiscovery + "<br>" +
|
||||
#endif // MQTT_DISCOVERY_ENABLE
|
||||
"Command topics: " + MqttClimate + channel_re + '/' + MQTT_CLIMATE_CMND +
|
||||
'/' + kClimateTopics +
|
||||
|
@ -1339,7 +1357,7 @@ void handleInfo(void) {
|
|||
"</p>"
|
||||
// Page footer
|
||||
"<hr><p><small><center>"
|
||||
"<i>(Note: Page will refresh every 60 seconds.)</i>"
|
||||
"<i>(Note: Page will refresh every 60 " D_STR_SECONDS ".)</i>"
|
||||
"<centre></small></p>";
|
||||
html += addJsReloadUrl(kUrlInfo, 60, false);
|
||||
html += htmlEnd();
|
||||
|
@ -1401,7 +1419,7 @@ void handleClearMqtt(void) {
|
|||
htmlHeader(F("Clearing saved info from MQTT"),
|
||||
F("Removing all saved settings for this device from "
|
||||
"MQTT.")) +
|
||||
"<p>Device restarting. Try connecting in a few seconds.</p>" +
|
||||
"<p>Device restarting. Try connecting in a few " D_STR_SECONDS ".</p>" +
|
||||
addJsReloadUrl(kUrlRoot, 10, true) +
|
||||
htmlEnd());
|
||||
// Do the clearing.
|
||||
|
@ -1423,7 +1441,7 @@ void handleReset(void) {
|
|||
server.send(200, "text/html",
|
||||
htmlHeader(F("Reset WiFi Config"),
|
||||
F("Resetting the WiFiManager config back to defaults.")) +
|
||||
"<p>Device restarting. Try connecting in a few seconds.</p>" +
|
||||
"<p>Device restarting. Try connecting in a few " D_STR_SECONDS ".</p>" +
|
||||
addJsReloadUrl(kUrlRoot, 10, true) +
|
||||
htmlEnd());
|
||||
// Do the reset.
|
||||
|
@ -1456,7 +1474,7 @@ void handleReboot() {
|
|||
#endif
|
||||
server.send(200, "text/html",
|
||||
htmlHeader(F("Device restarting.")) +
|
||||
"<p>Try connecting in a few seconds.</p>" +
|
||||
"<p>Try connecting in a few " D_STR_SECONDS ".</p>" +
|
||||
addJsReloadUrl(kUrlRoot, kRebootTime, true) +
|
||||
htmlEnd());
|
||||
doRestart("Reboot requested");
|
||||
|
@ -2012,7 +2030,8 @@ void setup_wifi(void) {
|
|||
|
||||
if (!wifiManager.autoConnect())
|
||||
// Reboot. A.k.a. "Have you tried turning it Off and On again?"
|
||||
doRestart("Wifi failed to connect and hit timeout. Rebooting...", true);
|
||||
doRestart(D_STR_WIFI " failed to connect and hit timeout. Rebooting...",
|
||||
true);
|
||||
|
||||
#if MQTT_ENABLE
|
||||
strncpy(MqttServer, custom_mqtt_server.getValue(), kHostnameLength);
|
||||
|
@ -2184,7 +2203,8 @@ void setup(void) {
|
|||
server.send(200, "text/html",
|
||||
htmlHeader(F("Updating firmware")) +
|
||||
"<hr>"
|
||||
"<h3>Warning! Don't power off the device for 60 seconds!</h3>"
|
||||
"<h3>Warning! Don't " D_STR_POWER " " D_STR_OFF " the device for "
|
||||
"60 " D_STR_SECONDS "!</h3>"
|
||||
"<p>The firmware is uploading and will try to flash itself. "
|
||||
"It is important to not interrupt the process.</p>"
|
||||
"<p>The firmware upload seems to have " +
|
||||
|
@ -2768,12 +2788,12 @@ bool sendIRCode(IRsend *irsend, decode_type_t const ir_type,
|
|||
} else {
|
||||
debug("Failed to send IR Message:");
|
||||
}
|
||||
debug("Type:");
|
||||
debug(D_STR_PROTOCOL ": ");
|
||||
debug(String(ir_type).c_str());
|
||||
// For "long" codes we basically repeat what we got.
|
||||
if (hasACState(ir_type) || ir_type == PRONTO || ir_type == RAW ||
|
||||
ir_type == GLOBALCACHE) {
|
||||
debug("Code: ");
|
||||
debug(D_STR_CODE ": ");
|
||||
debug(code_str);
|
||||
// Confirm what we were asked to send was sent.
|
||||
#if MQTT_ENABLE
|
||||
|
@ -2792,9 +2812,9 @@ bool sendIRCode(IRsend *irsend, decode_type_t const ir_type,
|
|||
}
|
||||
#endif // MQTT_ENABLE
|
||||
} else { // For "short" codes, we break it down a bit more before we report.
|
||||
debug(("Code: 0x" + uint64ToString(code, 16)).c_str());
|
||||
debug(("Bits: " + String(bits)).c_str());
|
||||
debug(("Repeats: " + String(repeat)).c_str());
|
||||
debug((D_STR_CODE ": 0x" + uint64ToString(code, 16)).c_str());
|
||||
debug((D_STR_BITS ": " + String(bits)).c_str());
|
||||
debug((D_STR_REPEAT ": " + String(repeat)).c_str());
|
||||
#if MQTT_ENABLE
|
||||
if (success) {
|
||||
mqtt_client.publish(MqttAck.c_str(), (String(ir_type) +
|
|
@ -65,7 +65,10 @@ IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message.
|
|||
void handleRoot() {
|
||||
server.send(200, "text/html",
|
||||
"<html>" \
|
||||
"<head><title>" HOSTNAME " Demo</title></head>" \
|
||||
"<head><title>" HOSTNAME " Demo </title>" \
|
||||
"<meta http-equiv=\"Content-Type\" " \
|
||||
"content=\"text/html;charset=utf-8\">" \
|
||||
"</head>" \
|
||||
"<body>" \
|
||||
"<h1>Hello from " HOSTNAME ", you can send NEC encoded IR" \
|
||||
"signals from here!</h1>" \
|
|
@ -0,0 +1,52 @@
|
|||
[platformio]
|
||||
src_dir = .
|
||||
|
||||
[env]
|
||||
; Default platform
|
||||
platform = espressif8266
|
||||
; Default board
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
lib_extra_dirs = ../../
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
board = nodemcuv2
|
||||
; build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
; build_flags = -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:de-CH]
|
||||
build_flags = -D_IR_LOCALE_=de-CH ; German (Swiss)
|
||||
|
||||
[env:de-DE]
|
||||
build_flags = -D_IR_LOCALE_=de-DE ; German
|
||||
|
||||
[env:en-AU]
|
||||
build_flags = -D_IR_LOCALE_=en-AU ; English (Australian) (Default)
|
||||
|
||||
[env:en-IE]
|
||||
build_flags = -D_IR_LOCALE_=en-IE ; English (Irish)
|
||||
|
||||
[env:en-UK]
|
||||
build_flags = -D_IR_LOCALE_=en-UK ; English (UK)
|
||||
|
||||
[env:en-US]
|
||||
build_flags = -D_IR_LOCALE_=en-US ; English (Simplified) (USA)
|
||||
|
||||
[env:es-ES]
|
||||
build_flags = -D_IR_LOCALE_=es-ES ; Spanish
|
||||
|
||||
[env:fr-FR]
|
||||
build_flags = -D_IR_LOCALE_=fr-FR ; French
|
||||
|
||||
[env:it-IT]
|
||||
build_flags = -D_IR_LOCALE_=it-IT ; Italian
|
||||
|
||||
[env:zh-CN]
|
||||
build_flags = -D_IR_LOCALE_=zh-CN ; Chinese (Simplified)
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -629,6 +629,7 @@ xorBytes KEYWORD2
|
|||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
|
||||
*kAllProtocolNamesStr LITERAL1
|
||||
// LITERAL1
|
||||
AIRWELL LITERAL1
|
||||
AIWA_RC_T501 LITERAL1
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "IRremoteESP8266",
|
||||
"version": "2.7.5",
|
||||
"version": "2.7.6",
|
||||
"keywords": "infrared, ir, remote, esp8266, esp32",
|
||||
"description": "Send and receive infrared signals with multiple protocols (ESP8266/ESP32)",
|
||||
"repository":
|
|
@ -1,5 +1,5 @@
|
|||
name=IRremoteESP8266
|
||||
version=2.7.5
|
||||
version=2.7.6
|
||||
author=David Conran, Sebastien Warin, Mark Szabo, Ken Shirriff
|
||||
maintainer=David Conran, Mark Szabo, Sebastien Warin, Roi Dayan, Massimiliano Pinto
|
||||
sentence=Send and receive infrared signals with multiple protocols (ESP8266/ESP32)
|
|
@ -0,0 +1,21 @@
|
|||
[platformio]
|
||||
# Default to building IRrecvDumpV2 if not in a specific example directory.
|
||||
src_dir = examples/IRrecvDumpV2
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = .
|
||||
lib_ldf_mode = deep+
|
||||
lib_ignore = examples
|
||||
framework = arduino
|
||||
platform = espressif8266
|
||||
build_flags = ; -D_IR_LOCALE_=en-AU
|
||||
|
||||
[env:nodemcuv2]
|
||||
board = nodemcuv2
|
||||
|
||||
[env:d1_mini]
|
||||
board = d1_mini
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
|
@ -52,7 +52,7 @@
|
|||
#endif // UNIT_TEST
|
||||
|
||||
// Library Version
|
||||
#define _IRREMOTEESP8266_VERSION_ "2.7.5"
|
||||
#define _IRREMOTEESP8266_VERSION_ "2.7.6"
|
||||
|
||||
// Set the language & locale for the library. See the `locale` dir for options.
|
||||
#ifndef _IR_LOCALE_
|
|
@ -163,3 +163,88 @@ const PROGMEM char* kFalseStr = D_STR_FALSE;
|
|||
const PROGMEM char* kRepeatStr = D_STR_REPEAT;
|
||||
const PROGMEM char* kCodeStr = D_STR_CODE;
|
||||
const PROGMEM char* kBitsStr = D_STR_BITS;
|
||||
|
||||
// Protocol Names
|
||||
// Needs to be in decode_type_t order.
|
||||
const PROGMEM char *kAllProtocolNamesStr =
|
||||
D_STR_UNUSED "\x0"
|
||||
D_STR_RC5 "\x0"
|
||||
D_STR_RC6 "\x0"
|
||||
D_STR_NEC "\x0"
|
||||
D_STR_SONY "\x0"
|
||||
D_STR_PANASONIC "\x0"
|
||||
D_STR_JVC "\x0"
|
||||
D_STR_SAMSUNG "\x0"
|
||||
D_STR_WHYNTER "\x0"
|
||||
D_STR_AIWA_RC_T501 "\x0"
|
||||
D_STR_LG "\x0"
|
||||
D_STR_SANYO "\x0"
|
||||
D_STR_MITSUBISHI "\x0"
|
||||
D_STR_DISH "\x0"
|
||||
D_STR_SHARP "\x0"
|
||||
D_STR_COOLIX "\x0"
|
||||
D_STR_DAIKIN "\x0"
|
||||
D_STR_DENON "\x0"
|
||||
D_STR_KELVINATOR "\x0"
|
||||
D_STR_SHERWOOD "\x0"
|
||||
D_STR_MITSUBISHI_AC "\x0"
|
||||
D_STR_RCMM "\x0"
|
||||
D_STR_SANYO_LC7461 "\x0"
|
||||
D_STR_RC5X "\x0"
|
||||
D_STR_GREE "\x0"
|
||||
D_STR_PRONTO "\x0"
|
||||
D_STR_NEC_LIKE "\x0"
|
||||
D_STR_ARGO "\x0"
|
||||
D_STR_TROTEC "\x0"
|
||||
D_STR_NIKAI "\x0"
|
||||
D_STR_RAW "\x0"
|
||||
D_STR_GLOBALCACHE "\x0"
|
||||
D_STR_TOSHIBA_AC "\x0"
|
||||
D_STR_FUJITSU_AC "\x0"
|
||||
D_STR_MIDEA "\x0"
|
||||
D_STR_MAGIQUEST "\x0"
|
||||
D_STR_LASERTAG "\x0"
|
||||
D_STR_CARRIER_AC "\x0"
|
||||
D_STR_HAIER_AC "\x0"
|
||||
D_STR_MITSUBISHI2 "\x0"
|
||||
D_STR_HITACHI_AC "\x0"
|
||||
D_STR_HITACHI_AC1 "\x0"
|
||||
D_STR_HITACHI_AC2 "\x0"
|
||||
D_STR_GICABLE "\x0"
|
||||
D_STR_HAIER_AC_YRW02 "\x0"
|
||||
D_STR_WHIRLPOOL_AC "\x0"
|
||||
D_STR_SAMSUNG_AC "\x0"
|
||||
D_STR_LUTRON "\x0"
|
||||
D_STR_ELECTRA_AC "\x0"
|
||||
D_STR_PANASONIC_AC "\x0"
|
||||
D_STR_PIONEER "\x0"
|
||||
D_STR_LG2 "\x0"
|
||||
D_STR_MWM "\x0"
|
||||
D_STR_DAIKIN2 "\x0"
|
||||
D_STR_VESTEL_AC "\x0"
|
||||
D_STR_TECO "\x0"
|
||||
D_STR_SAMSUNG36 "\x0"
|
||||
D_STR_TCL112AC "\x0"
|
||||
D_STR_LEGOPF "\x0"
|
||||
D_STR_MITSUBISHI_HEAVY_88 "\x0"
|
||||
D_STR_MITSUBISHI_HEAVY_152 "\x0"
|
||||
D_STR_DAIKIN216 "\x0"
|
||||
D_STR_SHARP_AC "\x0"
|
||||
D_STR_GOODWEATHER "\x0"
|
||||
D_STR_INAX "\x0"
|
||||
D_STR_DAIKIN160 "\x0"
|
||||
D_STR_NEOCLIMA "\x0"
|
||||
D_STR_DAIKIN176 "\x0"
|
||||
D_STR_DAIKIN128 "\x0"
|
||||
D_STR_AMCOR "\x0"
|
||||
D_STR_DAIKIN152 "\x0"
|
||||
D_STR_MITSUBISHI136 "\x0"
|
||||
D_STR_MITSUBISHI112 "\x0"
|
||||
D_STR_HITACHI_AC424 "\x0"
|
||||
D_STR_SONY_38K "\x0"
|
||||
D_STR_EPSON "\x0"
|
||||
D_STR_SYMPHONY "\x0"
|
||||
D_STR_HITACHI_AC3 "\x0"
|
||||
D_STR_DAIKIN64 "\x0"
|
||||
D_STR_AIRWELL "\x0"
|
||||
"\x0"; // This string requires double null termination.
|
|
@ -17,6 +17,7 @@ extern const char* k3DStr;
|
|||
extern const char* k6thSenseStr;
|
||||
extern const char* k8CHeatStr;
|
||||
extern const char* kAirFlowStr;
|
||||
extern const char *kAllProtocolNamesStr;
|
||||
extern const char* kAutomaticStr;
|
||||
extern const char* kAutoStr;
|
||||
extern const char* kBeepStr;
|
|
@ -91,169 +91,14 @@ void serialPrintUint64(uint64_t input, uint8_t base) {
|
|||
// Returns:
|
||||
// A decode_type_t enum.
|
||||
decode_type_t strToDecodeType(const char * const str) {
|
||||
if (!strcasecmp(str, kUnknownStr))
|
||||
return decode_type_t::UNKNOWN;
|
||||
else if (!strcasecmp(str, "UNUSED"))
|
||||
return decode_type_t::UNUSED;
|
||||
else if (!strcasecmp(str, "AIRWELL"))
|
||||
return decode_type_t::AIRWELL;
|
||||
else if (!strcasecmp(str, "AIWA_RC_T501"))
|
||||
return decode_type_t::AIWA_RC_T501;
|
||||
else if (!strcasecmp(str, "AMCOR"))
|
||||
return decode_type_t::AMCOR;
|
||||
else if (!strcasecmp(str, "ARGO"))
|
||||
return decode_type_t::ARGO;
|
||||
else if (!strcasecmp(str, "CARRIER_AC"))
|
||||
return decode_type_t::CARRIER_AC;
|
||||
else if (!strcasecmp(str, "COOLIX"))
|
||||
return decode_type_t::COOLIX;
|
||||
else if (!strcasecmp(str, "DAIKIN"))
|
||||
return decode_type_t::DAIKIN;
|
||||
else if (!strcasecmp(str, "DAIKIN128"))
|
||||
return decode_type_t::DAIKIN128;
|
||||
else if (!strcasecmp(str, "DAIKIN152"))
|
||||
return decode_type_t::DAIKIN152;
|
||||
else if (!strcasecmp(str, "DAIKIN160"))
|
||||
return decode_type_t::DAIKIN160;
|
||||
else if (!strcasecmp(str, "DAIKIN176"))
|
||||
return decode_type_t::DAIKIN176;
|
||||
else if (!strcasecmp(str, "DAIKIN2"))
|
||||
return decode_type_t::DAIKIN2;
|
||||
else if (!strcasecmp(str, "DAIKIN216"))
|
||||
return decode_type_t::DAIKIN216;
|
||||
else if (!strcasecmp(str, "DAIKIN64"))
|
||||
return decode_type_t::DAIKIN64;
|
||||
else if (!strcasecmp(str, "DENON"))
|
||||
return decode_type_t::DENON;
|
||||
else if (!strcasecmp(str, "DISH"))
|
||||
return decode_type_t::DISH;
|
||||
else if (!strcasecmp(str, "ELECTRA_AC"))
|
||||
return decode_type_t::ELECTRA_AC;
|
||||
else if (!strcasecmp(str, "EPSON"))
|
||||
return decode_type_t::EPSON;
|
||||
else if (!strcasecmp(str, "FUJITSU_AC"))
|
||||
return decode_type_t::FUJITSU_AC;
|
||||
else if (!strcasecmp(str, "GICABLE"))
|
||||
return decode_type_t::GICABLE;
|
||||
else if (!strcasecmp(str, "GLOBALCACHE"))
|
||||
return decode_type_t::GLOBALCACHE;
|
||||
else if (!strcasecmp(str, "GOODWEATHER"))
|
||||
return decode_type_t::GOODWEATHER;
|
||||
else if (!strcasecmp(str, "GREE"))
|
||||
return decode_type_t::GREE;
|
||||
else if (!strcasecmp(str, "HAIER_AC"))
|
||||
return decode_type_t::HAIER_AC;
|
||||
else if (!strcasecmp(str, "HAIER_AC_YRW02"))
|
||||
return decode_type_t::HAIER_AC_YRW02;
|
||||
else if (!strcasecmp(str, "HITACHI_AC"))
|
||||
return decode_type_t::HITACHI_AC;
|
||||
else if (!strcasecmp(str, "HITACHI_AC1"))
|
||||
return decode_type_t::HITACHI_AC1;
|
||||
else if (!strcasecmp(str, "HITACHI_AC2"))
|
||||
return decode_type_t::HITACHI_AC2;
|
||||
else if (!strcasecmp(str, "HITACHI_AC3"))
|
||||
return decode_type_t::HITACHI_AC3;
|
||||
else if (!strcasecmp(str, "HITACHI_AC424"))
|
||||
return decode_type_t::HITACHI_AC424;
|
||||
else if (!strcasecmp(str, "INAX"))
|
||||
return decode_type_t::INAX;
|
||||
else if (!strcasecmp(str, "JVC"))
|
||||
return decode_type_t::JVC;
|
||||
else if (!strcasecmp(str, "KELVINATOR"))
|
||||
return decode_type_t::KELVINATOR;
|
||||
else if (!strcasecmp(str, "LEGOPF"))
|
||||
return decode_type_t::LEGOPF;
|
||||
else if (!strcasecmp(str, "LG"))
|
||||
return decode_type_t::LG;
|
||||
else if (!strcasecmp(str, "LG2"))
|
||||
return decode_type_t::LG2;
|
||||
else if (!strcasecmp(str, "LASERTAG"))
|
||||
return decode_type_t::LASERTAG;
|
||||
else if (!strcasecmp(str, "LUTRON"))
|
||||
return decode_type_t::LUTRON;
|
||||
else if (!strcasecmp(str, "MAGIQUEST"))
|
||||
return decode_type_t::MAGIQUEST;
|
||||
else if (!strcasecmp(str, "MIDEA"))
|
||||
return decode_type_t::MIDEA;
|
||||
else if (!strcasecmp(str, "MITSUBISHI"))
|
||||
return decode_type_t::MITSUBISHI;
|
||||
else if (!strcasecmp(str, "MITSUBISHI2"))
|
||||
return decode_type_t::MITSUBISHI2;
|
||||
else if (!strcasecmp(str, "MITSUBISHI_AC"))
|
||||
return decode_type_t::MITSUBISHI_AC;
|
||||
else if (!strcasecmp(str, "MITSUBISHI136"))
|
||||
return decode_type_t::MITSUBISHI136;
|
||||
else if (!strcasecmp(str, "MITSUBISHI112"))
|
||||
return decode_type_t::MITSUBISHI112;
|
||||
else if (!strcasecmp(str, "MITSUBISHI_HEAVY_88"))
|
||||
return decode_type_t::MITSUBISHI_HEAVY_88;
|
||||
else if (!strcasecmp(str, "MITSUBISHI_HEAVY_152"))
|
||||
return decode_type_t::MITSUBISHI_HEAVY_152;
|
||||
else if (!strcasecmp(str, "MWM"))
|
||||
return decode_type_t::MWM;
|
||||
else if (!strcasecmp(str, "NEOCLIMA"))
|
||||
return decode_type_t::NEOCLIMA;
|
||||
else if (!strcasecmp(str, "NEC"))
|
||||
return decode_type_t::NEC;
|
||||
else if (!strcasecmp(str, "NEC_LIKE") ||
|
||||
!strcasecmp(str, "NEC (NON-STRICT)"))
|
||||
return decode_type_t::NEC_LIKE;
|
||||
else if (!strcasecmp(str, "NIKAI"))
|
||||
return decode_type_t::NIKAI;
|
||||
else if (!strcasecmp(str, "PANASONIC"))
|
||||
return decode_type_t::PANASONIC;
|
||||
else if (!strcasecmp(str, "PANASONIC_AC"))
|
||||
return decode_type_t::PANASONIC_AC;
|
||||
else if (!strcasecmp(str, "PIONEER"))
|
||||
return decode_type_t::PIONEER;
|
||||
else if (!strcasecmp(str, "PRONTO"))
|
||||
return decode_type_t::PRONTO;
|
||||
else if (!strcasecmp(str, "RAW"))
|
||||
return decode_type_t::RAW;
|
||||
else if (!strcasecmp(str, "RC5"))
|
||||
return decode_type_t::RC5;
|
||||
else if (!strcasecmp(str, "RC5X"))
|
||||
return decode_type_t::RC5X;
|
||||
else if (!strcasecmp(str, "RC6"))
|
||||
return decode_type_t::RC6;
|
||||
else if (!strcasecmp(str, "RCMM"))
|
||||
return decode_type_t::RCMM;
|
||||
else if (!strcasecmp(str, "SAMSUNG"))
|
||||
return decode_type_t::SAMSUNG;
|
||||
else if (!strcasecmp(str, "SAMSUNG36"))
|
||||
return decode_type_t::SAMSUNG36;
|
||||
else if (!strcasecmp(str, "SAMSUNG_AC"))
|
||||
return decode_type_t::SAMSUNG_AC;
|
||||
else if (!strcasecmp(str, "SANYO"))
|
||||
return decode_type_t::SANYO;
|
||||
else if (!strcasecmp(str, "SANYO_LC7461"))
|
||||
return decode_type_t::SANYO_LC7461;
|
||||
else if (!strcasecmp(str, "SHARP"))
|
||||
return decode_type_t::SHARP;
|
||||
else if (!strcasecmp(str, "SHARP_AC"))
|
||||
return decode_type_t::SHARP_AC;
|
||||
else if (!strcasecmp(str, "SHERWOOD"))
|
||||
return decode_type_t::SHERWOOD;
|
||||
else if (!strcasecmp(str, "SONY"))
|
||||
return decode_type_t::SONY;
|
||||
else if (!strcasecmp(str, "SONY_38K"))
|
||||
return decode_type_t::SONY_38K;
|
||||
else if (!strcasecmp(str, "SYMPHONY"))
|
||||
return decode_type_t::SYMPHONY;
|
||||
else if (!strcasecmp(str, "TCL112AC"))
|
||||
return decode_type_t::TCL112AC;
|
||||
else if (!strcasecmp(str, "TECO"))
|
||||
return decode_type_t::TECO;
|
||||
else if (!strcasecmp(str, "TOSHIBA_AC"))
|
||||
return decode_type_t::TOSHIBA_AC;
|
||||
else if (!strcasecmp(str, "TROTEC"))
|
||||
return decode_type_t::TROTEC;
|
||||
else if (!strcasecmp(str, "VESTEL_AC"))
|
||||
return decode_type_t::VESTEL_AC;
|
||||
else if (!strcasecmp(str, "WHIRLPOOL_AC"))
|
||||
return decode_type_t::WHIRLPOOL_AC;
|
||||
else if (!strcasecmp(str, "WHYNTER"))
|
||||
return decode_type_t::WHYNTER;
|
||||
const char *ptr = kAllProtocolNamesStr;
|
||||
uint16_t length = strlen(ptr);
|
||||
for (uint16_t i = 0; length; i++) {
|
||||
if (!strcasecmp(str, ptr)) return (decode_type_t)i;
|
||||
ptr += length + 1;
|
||||
length = strlen(ptr);
|
||||
}
|
||||
|
||||
// Handle integer values of the type by converting to a string and back again.
|
||||
decode_type_t result = strToDecodeType(
|
||||
typeToString((decode_type_t)atoi(str)).c_str());
|
||||
|
@ -271,251 +116,17 @@ decode_type_t strToDecodeType(const char * const str) {
|
|||
// A string containing the protocol name.
|
||||
String typeToString(const decode_type_t protocol, const bool isRepeat) {
|
||||
String result = "";
|
||||
switch (protocol) {
|
||||
case UNUSED:
|
||||
result = F("UNUSED");
|
||||
break;
|
||||
case AIRWELL:
|
||||
result = F("AIRWELL");
|
||||
break;
|
||||
case AIWA_RC_T501:
|
||||
result = F("AIWA_RC_T501");
|
||||
break;
|
||||
case AMCOR:
|
||||
result = F("AMCOR");
|
||||
break;
|
||||
case ARGO:
|
||||
result = F("ARGO");
|
||||
break;
|
||||
case CARRIER_AC:
|
||||
result = F("CARRIER_AC");
|
||||
break;
|
||||
case COOLIX:
|
||||
result = F("COOLIX");
|
||||
break;
|
||||
case DAIKIN:
|
||||
result = F("DAIKIN");
|
||||
break;
|
||||
case DAIKIN128:
|
||||
result = F("DAIKIN128");
|
||||
break;
|
||||
case DAIKIN152:
|
||||
result = F("DAIKIN152");
|
||||
break;
|
||||
case DAIKIN160:
|
||||
result = F("DAIKIN160");
|
||||
break;
|
||||
case DAIKIN176:
|
||||
result = F("DAIKIN176");
|
||||
break;
|
||||
case DAIKIN2:
|
||||
result = F("DAIKIN2");
|
||||
break;
|
||||
case DAIKIN216:
|
||||
result = F("DAIKIN216");
|
||||
break;
|
||||
case DAIKIN64:
|
||||
result = F("DAIKIN64");
|
||||
break;
|
||||
case DENON:
|
||||
result = F("DENON");
|
||||
break;
|
||||
case DISH:
|
||||
result = F("DISH");
|
||||
break;
|
||||
case ELECTRA_AC:
|
||||
result = F("ELECTRA_AC");
|
||||
break;
|
||||
case EPSON:
|
||||
result = F("EPSON");
|
||||
break;
|
||||
case FUJITSU_AC:
|
||||
result = F("FUJITSU_AC");
|
||||
break;
|
||||
case GICABLE:
|
||||
result = F("GICABLE");
|
||||
break;
|
||||
case GLOBALCACHE:
|
||||
result = F("GLOBALCACHE");
|
||||
break;
|
||||
case GOODWEATHER:
|
||||
result = F("GOODWEATHER");
|
||||
break;
|
||||
case GREE:
|
||||
result = F("GREE");
|
||||
break;
|
||||
case HAIER_AC:
|
||||
result = F("HAIER_AC");
|
||||
break;
|
||||
case HAIER_AC_YRW02:
|
||||
result = F("HAIER_AC_YRW02");
|
||||
break;
|
||||
case HITACHI_AC:
|
||||
result = F("HITACHI_AC");
|
||||
break;
|
||||
case HITACHI_AC1:
|
||||
result = F("HITACHI_AC1");
|
||||
break;
|
||||
case HITACHI_AC2:
|
||||
result = F("HITACHI_AC2");
|
||||
break;
|
||||
case HITACHI_AC3:
|
||||
result = F("HITACHI_AC3");
|
||||
break;
|
||||
case HITACHI_AC424:
|
||||
result = F("HITACHI_AC424");
|
||||
break;
|
||||
case INAX:
|
||||
result = F("INAX");
|
||||
break;
|
||||
case JVC:
|
||||
result = F("JVC");
|
||||
break;
|
||||
case KELVINATOR:
|
||||
result = F("KELVINATOR");
|
||||
break;
|
||||
case LEGOPF:
|
||||
result = F("LEGOPF");
|
||||
break;
|
||||
case LG:
|
||||
result = F("LG");
|
||||
break;
|
||||
case LG2:
|
||||
result = F("LG2");
|
||||
break;
|
||||
case LASERTAG:
|
||||
result = F("LASERTAG");
|
||||
break;
|
||||
case LUTRON:
|
||||
result = F("LUTRON");
|
||||
break;
|
||||
case MAGIQUEST:
|
||||
result = F("MAGIQUEST");
|
||||
break;
|
||||
case MIDEA:
|
||||
result = F("MIDEA");
|
||||
break;
|
||||
case MITSUBISHI:
|
||||
result = F("MITSUBISHI");
|
||||
break;
|
||||
case MITSUBISHI2:
|
||||
result = F("MITSUBISHI2");
|
||||
break;
|
||||
case MITSUBISHI_AC:
|
||||
result = F("MITSUBISHI_AC");
|
||||
break;
|
||||
case MITSUBISHI136:
|
||||
result = F("MITSUBISHI136");
|
||||
break;
|
||||
case MITSUBISHI112:
|
||||
result = F("MITSUBISHI112");
|
||||
break;
|
||||
case MITSUBISHI_HEAVY_88:
|
||||
result = F("MITSUBISHI_HEAVY_88");
|
||||
break;
|
||||
case MITSUBISHI_HEAVY_152:
|
||||
result = F("MITSUBISHI_HEAVY_152");
|
||||
break;
|
||||
case MWM:
|
||||
result = F("MWM");
|
||||
break;
|
||||
case NEOCLIMA:
|
||||
result = F("NEOCLIMA");
|
||||
break;
|
||||
case NEC:
|
||||
result = F("NEC");
|
||||
break;
|
||||
case NEC_LIKE:
|
||||
result = F("NEC (non-strict)");
|
||||
break;
|
||||
case NIKAI:
|
||||
result = F("NIKAI");
|
||||
break;
|
||||
case PANASONIC:
|
||||
result = F("PANASONIC");
|
||||
break;
|
||||
case PANASONIC_AC:
|
||||
result = F("PANASONIC_AC");
|
||||
break;
|
||||
case PIONEER:
|
||||
result = F("PIONEER");
|
||||
break;
|
||||
case PRONTO:
|
||||
result = F("PRONTO");
|
||||
break;
|
||||
case RAW:
|
||||
result = F("RAW");
|
||||
break;
|
||||
case RC5:
|
||||
result = F("RC5");
|
||||
break;
|
||||
case RC5X:
|
||||
result = F("RC5X");
|
||||
break;
|
||||
case RC6:
|
||||
result = F("RC6");
|
||||
break;
|
||||
case RCMM:
|
||||
result = F("RCMM");
|
||||
break;
|
||||
case SAMSUNG:
|
||||
result = F("SAMSUNG");
|
||||
break;
|
||||
case SAMSUNG36:
|
||||
result = F("SAMSUNG36");
|
||||
break;
|
||||
case SAMSUNG_AC:
|
||||
result = F("SAMSUNG_AC");
|
||||
break;
|
||||
case SANYO:
|
||||
result = F("SANYO");
|
||||
break;
|
||||
case SANYO_LC7461:
|
||||
result = F("SANYO_LC7461");
|
||||
break;
|
||||
case SHARP:
|
||||
result = F("SHARP");
|
||||
break;
|
||||
case SHARP_AC:
|
||||
result = F("SHARP_AC");
|
||||
break;
|
||||
case SHERWOOD:
|
||||
result = F("SHERWOOD");
|
||||
break;
|
||||
case SONY:
|
||||
result = F("SONY");
|
||||
break;
|
||||
case SONY_38K:
|
||||
result = F("SONY_38K");
|
||||
break;
|
||||
case SYMPHONY:
|
||||
result = F("SYMPHONY");
|
||||
break;
|
||||
case TCL112AC:
|
||||
result = F("TCL112AC");
|
||||
break;
|
||||
case TECO:
|
||||
result = F("TECO");
|
||||
break;
|
||||
case TOSHIBA_AC:
|
||||
result = F("TOSHIBA_AC");
|
||||
break;
|
||||
case TROTEC:
|
||||
result = F("TROTEC");
|
||||
break;
|
||||
case VESTEL_AC:
|
||||
result = F("VESTEL_AC");
|
||||
break;
|
||||
case WHIRLPOOL_AC:
|
||||
result = F("WHIRLPOOL_AC");
|
||||
break;
|
||||
case WHYNTER:
|
||||
result = F("WHYNTER");
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
result = kUnknownStr;
|
||||
break;
|
||||
const char *ptr = kAllProtocolNamesStr;
|
||||
if (protocol > kLastDecodeType || protocol == decode_type_t::UNKNOWN) {
|
||||
result = kUnknownStr;
|
||||
} else {
|
||||
for (uint16_t i = 0; i <= protocol && strlen(ptr); i++) {
|
||||
if (i == protocol) {
|
||||
result = ptr;
|
||||
break;
|
||||
}
|
||||
ptr += strlen(ptr) + 1;
|
||||
}
|
||||
}
|
||||
if (isRepeat) {
|
||||
result += kSpaceLBraceStr;
|