Merge pull request #7031 from s-hadinger/ir_271

Lib IRremoteESP8266 updated to v2.7.1
This commit is contained in:
Theo Arends 2019-11-26 08:07:21 +01:00 committed by GitHub
commit 8335828e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
241 changed files with 996 additions and 532 deletions

View File

@ -1,153 +0,0 @@
// Copyright 2019 - David Conran (@crankyoldgit)
#ifndef UNIT_TEST
#include <Arduino.h>
#endif // UNIT_TEST
#include "IRremoteESP8266.h"
#include "i18n.h"
// Common
#ifdef USE_IR_REMOTE_FULL // full IR protocols
String kUnknownStr = D_STR_UNKNOWN;
String kProtocolStr = D_STR_PROTOCOL;
String kPowerStr = D_STR_POWER;
String kOnStr = D_STR_ON;
String kOffStr = D_STR_OFF;
String kModeStr = D_STR_MODE;
String kToggleStr = D_STR_TOGGLE;
String kTurboStr = D_STR_TURBO;
String kSuperStr = D_STR_SUPER;
String kSleepStr = D_STR_SLEEP;
String kLightStr = D_STR_LIGHT;
String kPowerfulStr = D_STR_POWERFUL;
String kQuietStr = D_STR_QUIET;
String kEconoStr = D_STR_ECONO;
String kSwingStr = D_STR_SWING;
String kSwingHStr = D_STR_SWINGH;
String kSwingVStr = D_STR_SWINGV;
String kBeepStr = D_STR_BEEP;
String kZoneFollowStr = D_STR_ZONEFOLLOW;
String kFixedStr = D_STR_FIXED;
String kMouldStr = D_STR_MOULD;
String kCleanStr = D_STR_CLEAN;
String kPurifyStr = D_STR_PURIFY;
String kTimerStr = D_STR_TIMER;
String kOnTimerStr = D_STR_ONTIMER;
String kOffTimerStr = D_STR_OFFTIMER;
String kClockStr = D_STR_CLOCK;
String kCommandStr = D_STR_COMMAND;
String kXFanStr = D_STR_XFAN;
String kHealthStr = D_STR_HEALTH;
String kModelStr = D_STR_MODEL;
String kTempStr = D_STR_TEMP;
String kIFeelStr = D_STR_IFEEL;
String kHumidStr = D_STR_HUMID;
String kSaveStr = D_STR_SAVE;
String kEyeStr = D_STR_EYE;
String kFollowStr = D_STR_FOLLOW;
String kIonStr = D_STR_ION;
String kFreshStr = D_STR_FRESH;
String kHoldStr = D_STR_HOLD;
String kButtonStr = D_STR_BUTTON;
String k8CHeatStr = D_STR_8C_HEAT;
String kNightStr = D_STR_NIGHT;
String kSilentStr = D_STR_SILENT;
String kFilterStr = D_STR_FILTER;
String k3DStr = D_STR_3D;
String kCelsiusStr = D_STR_CELSIUS;
String kTempUpStr = D_STR_TEMPUP;
String kTempDownStr = D_STR_TEMPDOWN;
String kStartStr = D_STR_START;
String kStopStr = D_STR_STOP;
String kMoveStr = D_STR_MOVE;
String kSetStr = D_STR_SET;
String kCancelStr = D_STR_CANCEL;
String kUpStr = D_STR_UP;
String kDownStr = D_STR_DOWN;
String kChangeStr = D_STR_CHANGE;
String kComfortStr = D_STR_COMFORT;
String kSensorStr = D_STR_SENSOR;
String kWeeklyTimerStr = D_STR_WEEKLYTIMER;
String kWifiStr = D_STR_WIFI;
String kLastStr = D_STR_LAST;
String kFastStr = D_STR_FAST;
String kSlowStr = D_STR_SLOW;
String kAirFlowStr = D_STR_AIRFLOW;
String kStepStr = D_STR_STEP;
String kNAStr = D_STR_NA;
String kOutsideStr = D_STR_OUTSIDE;
String kLoudStr = D_STR_LOUD;
String kLowerStr = D_STR_LOWER;
String kUpperStr = D_STR_UPPER;
String kBreezeStr = D_STR_BREEZE;
String kCirculateStr = D_STR_CIRCULATE;
String kCeilingStr = D_STR_CEILING;
String kWallStr = D_STR_WALL;
String kRoomStr = D_STR_ROOM;
String k6thSenseStr = D_STR_6THSENSE;
String kAutoStr = D_STR_AUTO;
String kAutomaticStr = D_STR_AUTOMATIC;
String kManualStr = D_STR_MANUAL;
String kCoolStr = D_STR_COOL;
String kHeatStr = D_STR_HEAT;
String kFanStr = D_STR_FAN;
String kDryStr = D_STR_DRY;
String kFanOnlyStr = D_STR_FANONLY;
String kMaxStr = D_STR_MAX;
String kMaximumStr = D_STR_MAXIMUM;
String kMinStr = D_STR_MIN;
String kMinimumStr = D_STR_MINIMUM;
String kMedStr = D_STR_MED;
String kMediumStr = D_STR_MEDIUM;
String kHighestStr = D_STR_HIGHEST;
String kHighStr = D_STR_HIGH;
String kHiStr = D_STR_HI;
String kMidStr = D_STR_MID;
String kMiddleStr = D_STR_MIDDLE;
String kLowStr = D_STR_LOW;
String kLoStr = D_STR_LO;
String kLowestStr = D_STR_LOWEST;
String kMaxRightStr = D_STR_MAXRIGHT;
String kRightMaxStr = D_STR_RIGHTMAX_NOSPACE;
String kRightStr = D_STR_RIGHT;
String kLeftStr = D_STR_LEFT;
String kMaxLeftStr = D_STR_MAXLEFT;
String kLeftMaxStr = D_STR_LEFTMAX_NOSPACE;
String kWideStr = D_STR_WIDE;
String kCentreStr = D_STR_CENTRE;
String kTopStr = D_STR_TOP;
String kBottomStr = D_STR_BOTTOM;
String kSpaceLBraceStr = D_STR_SPACELBRACE;
String kCommaSpaceStr = D_STR_COMMASPACE;
String kColonSpaceStr = D_STR_COLONSPACE;
// IRutils
// - Time
char kTimeSep = D_CHR_TIME_SEP;
String kDayStr = D_STR_DAY;
String kDaysStr = D_STR_DAYS;
String kHourStr = D_STR_HOUR;
String kHoursStr = D_STR_HOURS;
String kMinuteStr = D_STR_MINUTE;
String kMinutesStr = D_STR_MINUTES;
String kSecondStr = D_STR_SECOND;
String kSecondsStr = D_STR_SECONDS;
String kNowStr = D_STR_NOW;
String kThreeLetterDayOfWeekStr = D_STR_THREELETTERDAYS;
String kYesStr = D_STR_YES;
String kNoStr = D_STR_NO;
String kTrueStr = D_STR_TRUE;
String kFalseStr = D_STR_FALSE;
String kRepeatStr = D_STR_REPEAT;
String kCodeStr = D_STR_CODE;
String kBitsStr = D_STR_BITS;
#endif // USE_IR_REMOTE_FULL // full IR protocols

View File

@ -1,146 +0,0 @@
// Copyright 2019 - David Conran (@crankyoldgit)
// This header file is to be included in files **other than** 'IRtext.cpp'.
//
// WARNING: Do not edit this file! This file is automatically generated by
// 'tools/generate_irtext_h.sh'.
#ifndef IRTEXT_H_
#define IRTEXT_H_
#include "i18n.h"
// Constant text to be shared across all object files.
// This means there is only one copy of the character/string/text etc.
extern const char kTimeSep;
extern const String k3DStr;
extern const String k6thSenseStr;
extern const String k8CHeatStr;
extern const String kAirFlowStr;
extern const String kAutomaticStr;
extern const String kAutoStr;
extern const String kBeepStr;
extern const String kBitsStr;
extern const String kBottomStr;
extern const String kBreezeStr;
extern const String kButtonStr;
extern const String kCancelStr;
extern const String kCeilingStr;
extern const String kCelsiusStr;
extern const String kCentreStr;
extern const String kChangeStr;
extern const String kCirculateStr;
extern const String kCleanStr;
extern const String kClockStr;
extern const String kCodeStr;
extern const String kColonSpaceStr;
extern const String kComfortStr;
extern const String kCommandStr;
extern const String kCommaSpaceStr;
extern const String kCoolStr;
extern const String kDaysStr;
extern const String kDayStr;
extern const String kDownStr;
extern const String kDryStr;
extern const String kEconoStr;
extern const String kEyeStr;
extern const String kFalseStr;
extern const String kFanOnlyStr;
extern const String kFanStr;
extern const String kFastStr;
extern const String kFilterStr;
extern const String kFixedStr;
extern const String kFollowStr;
extern const String kFreshStr;
extern const String kHealthStr;
extern const String kHeatStr;
extern const String kHighestStr;
extern const String kHighStr;
extern const String kHiStr;
extern const String kHoldStr;
extern const String kHoursStr;
extern const String kHourStr;
extern const String kHumidStr;
extern const String kIFeelStr;
extern const String kIonStr;
extern const String kLastStr;
extern const String kLeftMaxStr;
extern const String kLeftStr;
extern const String kLightStr;
extern const String kLoStr;
extern const String kLoudStr;
extern const String kLowerStr;
extern const String kLowestStr;
extern const String kLowStr;
extern const String kManualStr;
extern const String kMaximumStr;
extern const String kMaxLeftStr;
extern const String kMaxRightStr;
extern const String kMaxStr;
extern const String kMediumStr;
extern const String kMedStr;
extern const String kMiddleStr;
extern const String kMidStr;
extern const String kMinimumStr;
extern const String kMinStr;
extern const String kMinutesStr;
extern const String kMinuteStr;
extern const String kModelStr;
extern const String kModeStr;
extern const String kMouldStr;
extern const String kMoveStr;
extern const String kNAStr;
extern const String kNightStr;
extern const String kNoStr;
extern const String kNowStr;
extern const String kOffStr;
extern const String kOffTimerStr;
extern const String kOnStr;
extern const String kOnTimerStr;
extern const String kOutsideStr;
extern const String kPowerfulStr;
extern const String kPowerStr;
extern const String kProtocolStr;
extern const String kPurifyStr;
extern const String kQuietStr;
extern const String kRepeatStr;
extern const String kRightMaxStr;
extern const String kRightStr;
extern const String kRoomStr;
extern const String kSaveStr;
extern const String kSecondsStr;
extern const String kSecondStr;
extern const String kSensorStr;
extern const String kSetStr;
extern const String kSilentStr;
extern const String kSleepStr;
extern const String kSlowStr;
extern const String kSpaceLBraceStr;
extern const String kStartStr;
extern const String kStepStr;
extern const String kStopStr;
extern const String kSuperStr;
extern const String kSwingHStr;
extern const String kSwingStr;
extern const String kSwingVStr;
extern const String kTempDownStr;
extern const String kTempStr;
extern const String kTempUpStr;
extern const String kThreeLetterDayOfWeekStr;
extern const String kTimerStr;
extern const String kToggleStr;
extern const String kTopStr;
extern const String kTrueStr;
extern const String kTurboStr;
extern const String kUnknownStr;
extern const String kUpperStr;
extern const String kUpStr;
extern const String kWallStr;
extern const String kWeeklyTimerStr;
extern const String kWideStr;
extern const String kWifiStr;
extern const String kXFanStr;
extern const String kYesStr;
extern const String kZoneFollowStr;
#endif // IRTEXT_H_

View File

@ -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.0 Now Available
Version 2.7.0 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.1 Now Available
Version 2.7.1 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.

View File

@ -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.0 disponible
Version 2.7.0 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.1 disponible
Version 2.7.1 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.

View File

@ -1,5 +1,20 @@
# Release Notes
## _v2.7.1 (20191125)_
**[Bug Fixes]**
- Hitachi424Ac: Fix Incorrect Power Byte Values (#987)
- Coolix: Fix setPower(false) issue. (#990)
**[Features]**
- Use `char*` instead of `String` for common text. Saves ~1-3k. (#992, #989)
- Hitachi424Ac: Add Vertical Swing ability (#986)
**[Misc]**
- IRMQTTServer: Update HA example/discovery message. (#995)
- Move newly added common text to a better location. (#993)
## _v2.7.0 (20191030)_
**[Bug Fixes]**

View File

@ -1,6 +1,6 @@
<!--- WARNING: Do NOT edit this file directly.
It is generated by './tools/scrape_supported_devices.py'.
Last generated: Wed Oct 30 13:41:10 2019 --->
Last generated: Mon Nov 25 11:12:06 2019 --->
# IR Protocols supported by this library
| Protocol | Brand | Model | A/C Model | Detailed A/C Support |

View File

@ -11,6 +11,7 @@
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRsend.h>
#include <IRtext.h>
#include <IRtimer.h>
#include <IRutils.h>
#include <IRac.h>
@ -237,7 +238,7 @@ const uint16_t kJsonAcStateMaxSize = 1024; // Bytes
// ----------------- End of User Configuration Section -------------------------
// Constants
#define _MY_VERSION_ "v1.4.4"
#define _MY_VERSION_ "v1.4.5"
const uint8_t kRebootTime = 15; // Seconds
const uint8_t kQuickDisplayTime = 2; // Seconds

View File

@ -12,7 +12,7 @@
* A compatible IR RX modules SHOULD be connected to ESP
* if you want to capture & decode IR nessages. e.g. GPIO14 (D5)
* See 'IR_RX' in IRMQTTServer.h.
* GPIOs are configurable from the http://<your_esp8266's_ip_address>/gpio
* GPIOs are configurable from the http://<your_esp's_ip_address>/gpio
* page.
*
* WARN: This is *very* advanced & complicated example code. Not for beginners.
@ -56,25 +56,25 @@
* https://github.com/tzapu/WiFiManager#how-it-works
*
* If you need to reset the WiFi and saved settings to go back to "First Boot",
* visit: http://<your_esp8266's_ip_address>/reset
* visit: http://<your_esp's_ip_address>/reset
*
* ## Normal Use (After initial setup)
* Enter 'http://<your_esp8266's_ip_address/' in your browser & follow the
* Enter 'http://<your_esp's_ip_address/' in your browser & follow the
* instructions there to send IR codes via HTTP/HTML.
* Visit the http://<your_esp8266's_ip_address>/gpio page to configure the GPIOs
* Visit the http://<your_esp's_ip_address>/gpio page to configure the GPIOs
* for the IR LED(s) and/or IR RX demodulator.
*
* You can send URLs like the following, with similar data type limitations as
* the MQTT formating in the next section. e.g:
* http://<your_esp8266's_ip_address>/ir?type=7&code=E0E09966
* http://<your_esp8266's_ip_address>/ir?type=4&code=0xf50&bits=12
* http://<your_esp8266's_ip_address>/ir?code=C1A2E21D&repeats=8&type=19
* http://<your_esp8266's_ip_address>/ir?type=31&code=40000,1,1,96,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,24,24,24,1058
* http://<your_esp8266's_ip_address>/ir?type=18&code=190B8050000000E0190B8070000010f0
* http://<your_esp8266's_ip_address>/ir?repeats=1&type=25&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
* http://<your_esp's_ip_address>/ir?type=7&code=E0E09966
* http://<your_esp's_ip_address>/ir?type=4&code=0xf50&bits=12
* http://<your_esp's_ip_address>/ir?code=C1A2E21D&repeats=8&type=19
* http://<your_esp's_ip_address>/ir?type=31&code=40000,1,1,96,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,24,24,24,1058
* http://<your_esp's_ip_address>/ir?type=18&code=190B8050000000E0190B8070000010f0
* http://<your_esp's_ip_address>/ir?repeats=1&type=25&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
* If you have enabled more than 1 TX GPIO, you can use the "channel" argument:
* http://<your_esp8266's_ip_address>/ir?channel=0&type=7&code=E0E09966
* http://<your_esp8266's_ip_address>/ir?channel=1&type=7&code=E0E09966
* http://<your_esp's_ip_address>/ir?channel=0&type=7&code=E0E09966
* http://<your_esp's_ip_address>/ir?channel=1&type=7&code=E0E09966
*
* or
*
@ -241,20 +241,20 @@
* - "dry"
* - "fan_only"
* fan_modes:
* - "auto"
* - "min"
* - "low"
* - "medium"
* - "high"
* - "max"
* - "Auto"
* - "Min"
* - "Low"
* - "Medium"
* - "High"
* - "Max"
* swing_modes:
* - "off"
* - "auto"
* - "highest"
* - "high"
* - "middle"
* - "low"
* - "lowest"
* - "Off"
* - "Auto"
* - "Highest"
* - "High"
* - "Middle"
* - "Low"
* - "Lowest"
* power_command_topic: "ir_server/ac/cmnd/power"
* mode_command_topic: "ir_server/ac/cmnd/mode"
* mode_state_topic: "ir_server/ac/stat/mode"
@ -284,13 +284,13 @@
* first TX GPIO climate. You will need to manually configure the others.
*
* ### via HTTP:
* Use the "http://<your_esp8266's_ip_address>/aircon/set" URL and pass on
* Use the "http://<your_esp's_ip_address>/aircon/set" URL and pass on
* the arguments as needed to control your device. See the `KEY_*` #defines
* in the code for all the parameters.
* i.e. protocol, model, power, mode, temp, fanspeed, swingv, swingh, quiet,
* turbo, light, beep, econo, sleep, filter, clean, use_celsius, channel
* Example:
* http://<your_esp8266's_ip_address>/aircon/set?channel=0&protocol=PANASONIC_AC&model=LKE&power=on&mode=auto&fanspeed=min&temp=23
* http://<your_esp's_ip_address>/aircon/set?channel=0&protocol=PANASONIC_AC&model=LKE&power=on&mode=auto&fanspeed=min&temp=23
*
* NOTE: If you don't set the channel, the first GPIO (Channel 0) is used.
*
@ -353,6 +353,7 @@
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRsend.h>
#include <IRtext.h>
#include <IRtimer.h>
#include <IRutils.h>
#include <IRac.h>
@ -1181,7 +1182,7 @@ void handleAdmin(void) {
#endif // MQTT_ENABLE
html += htmlButton(
kUrlReboot, F("Reboot"),
F("A simple reboot of the ESP8266. <small>ie. No changes</small><br>"
F("A simple reboot of the ESP. <small>ie. No changes</small><br>"
"<br>"));
html += htmlButton(
kUrlWipe, F("Wipe Settings"),
@ -2514,6 +2515,8 @@ void sendMQTTDiscovery(const char *topic) {
"\"pow_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_POWER "\","
"\"mode_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_MODE "\","
"\"mode_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_MODE "\","
// I don't know why, but the modes need to be lower case to work with
// Home Assistant & Google Home.
"\"modes\":[\"off\",\"auto\",\"cool\",\"heat\",\"dry\",\"fan_only\"],"
"\"temp_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_TEMP "\","
"\"temp_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_TEMP "\","
@ -2522,11 +2525,13 @@ void sendMQTTDiscovery(const char *topic) {
"\"temp_step\":\"1\","
"\"fan_mode_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_FANSPEED "\","
"\"fan_mode_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_FANSPEED "\","
"\"fan_modes\":[\"auto\",\"min\",\"low\",\"medium\",\"high\",\"max\"],"
"\"fan_modes\":[\"" D_STR_AUTO "\",\"" D_STR_MIN "\",\"" D_STR_LOW "\",\""
D_STR_MEDIUM "\",\"" D_STR_HIGH "\",\"" D_STR_MAX "\"],"
"\"swing_mode_cmd_t\":\"~/" MQTT_CLIMATE_CMND "/" KEY_SWINGV "\","
"\"swing_mode_stat_t\":\"~/" MQTT_CLIMATE_STAT "/" KEY_SWINGV "\","
"\"swing_modes\":["
"\"off\",\"auto\",\"highest\",\"high\",\"middle\",\"low\",\"lowest\"]"
"\"swing_modes\":[\"" D_STR_OFF "\",\"" D_STR_AUTO "\",\"" D_STR_HIGHEST
"\",\"" D_STR_HIGH "\",\"" D_STR_MIDDLE "\",\""
D_STR_LOW "\",\"" D_STR_LOWEST "\"]"
"}").c_str(), true)) {
mqttLog("MQTT climate discovery successful sent.");
hasDiscoveryBeenSent = true;
@ -2961,16 +2966,15 @@ bool sendClimate(const String topic_prefix, const bool retain,
diff = true;
success &= sendInt(topic_prefix + KEY_MODEL, next.model, retain);
}
String mode_str = IRac::opmodeToString(next.mode);
// I don't know why, but the modes need to be lower case to work with
// Home Assistant & Google Home.
mode_str.toLowerCase();
#if MQTT_CLIMATE_HA_MODE
// Home Assistant want's these two bound together.
if (prev.power != next.power || prev.mode != next.mode || forceMQTT) {
diff = true;
success &= sendBool(topic_prefix + KEY_POWER, next.power, retain);
success &= sendString(topic_prefix + KEY_MODE,
(next.power ? IRac::opmodeToString(next.mode)
: F("off")),
retain);
}
if (!next.power) mode_str = F("off");
#else // MQTT_CLIMATE_HA_MODE
// In non-Home Assistant mode, power and mode are not bound together.
if (prev.power != next.power || forceMQTT) {
@ -2978,11 +2982,10 @@ bool sendClimate(const String topic_prefix, const bool retain,
success &= sendBool(topic_prefix + KEY_POWER, next.power, retain);
}
if (prev.mode != next.mode || forceMQTT) {
diff = true;
success &= sendString(topic_prefix + KEY_MODE,
IRac::opmodeToString(next.mode), retain);
}
#endif // MQTT_CLIMATE_HA_MODE
success &= sendString(topic_prefix + KEY_MODE, mode_str, retain);
diff = true;
}
if (prev.degrees != next.degrees || forceMQTT) {
diff = true;
success &= sendFloat(topic_prefix + KEY_TEMP, next.degrees, retain);

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -920,6 +920,7 @@ PANASONIC LITERAL1
PANASONIC_AC LITERAL1
PANASONIC_BITS LITERAL1
PIONEER LITERAL1
PROGMEM LITERAL1
PRONTO LITERAL1
RAW LITERAL1
RAWTICK LITERAL1
@ -1052,6 +1053,10 @@ WHYNTER LITERAL1
WHYNTER_BITS LITERAL1
YAW1F LITERAL1
YBOFB LITERAL1
k3DStr LITERAL1
k6thSenseStr LITERAL1
k8CHeatStr LITERAL1
kAirFlowStr LITERAL1
kAiwaRcT501Bits LITERAL1
kAiwaRcT501MinRepeats LITERAL1
kAiwaRcT501PostBits LITERAL1
@ -1152,6 +1157,14 @@ kArgoTempLowOffset LITERAL1
kArgoTempLowSize LITERAL1
kArgoZeroSpace LITERAL1
kAuto LITERAL1
kAutoStr LITERAL1
kAutomaticStr LITERAL1
kBeepStr LITERAL1
kBitsStr LITERAL1
kBottomStr LITERAL1
kBreezeStr LITERAL1
kButtonStr LITERAL1
kCancelStr LITERAL1
kCarrierAcBitMark LITERAL1
kCarrierAcBits LITERAL1
kCarrierAcGap LITERAL1
@ -1160,7 +1173,20 @@ kCarrierAcHdrSpace LITERAL1
kCarrierAcMinRepeat LITERAL1
kCarrierAcOneSpace LITERAL1
kCarrierAcZeroSpace LITERAL1
kCeilingStr LITERAL1
kCelsiusStr LITERAL1
kCentreStr LITERAL1
kChangeStr LITERAL1
kCirculateStr LITERAL1
kCleanStr LITERAL1
kClockStr LITERAL1
kCodeStr LITERAL1
kColonSpaceStr LITERAL1
kComfortStr LITERAL1
kCommaSpaceStr LITERAL1
kCommandStr LITERAL1
kCool LITERAL1
kCoolStr LITERAL1
kCoolixAuto LITERAL1
kCoolixBitMark LITERAL1
kCoolixBitMarkTicks LITERAL1
@ -1537,6 +1563,8 @@ kDaikinTempSize LITERAL1
kDaikinTolerance LITERAL1
kDaikinUnusedTime LITERAL1
kDaikinZeroSpace LITERAL1
kDayStr LITERAL1
kDaysStr LITERAL1
kDefaultESP32Timer LITERAL1
kDefaultMessageGap LITERAL1
kDenon48Bits LITERAL1
@ -1572,9 +1600,12 @@ kDishRptSpaceTicks LITERAL1
kDishTick LITERAL1
kDishZeroSpace LITERAL1
kDishZeroSpaceTicks LITERAL1
kDownStr LITERAL1
kDry LITERAL1
kDryStr LITERAL1
kDutyDefault LITERAL1
kDutyMax LITERAL1
kEconoStr LITERAL1
kElectraAcAuto LITERAL1
kElectraAcBitMark LITERAL1
kElectraAcBits LITERAL1
@ -1607,10 +1638,20 @@ kElectraAcTempDelta LITERAL1
kElectraAcTempOffset LITERAL1
kElectraAcTempSize LITERAL1
kElectraAcZeroSpace LITERAL1
kEyeAutoStr LITERAL1
kEyeStr LITERAL1
kFalseStr LITERAL1
kFan LITERAL1
kFanOnlyStr LITERAL1
kFanStr LITERAL1
kFastStr LITERAL1
kFilterStr LITERAL1
kFixedStr LITERAL1
kFnvBasis32 LITERAL1
kFnvPrime32 LITERAL1
kFollowStr LITERAL1
kFooter LITERAL1
kFreshStr LITERAL1
kFujitsuAcBitMark LITERAL1
kFujitsuAcBits LITERAL1
kFujitsuAcCleanOffset LITERAL1
@ -1863,10 +1904,15 @@ kHaierAcYrw02TurboOffset LITERAL1
kHaierAcYrw02TurboSize LITERAL1
kHaierAcZeroSpace LITERAL1
kHeader LITERAL1
kHealthStr LITERAL1
kHeat LITERAL1
kHeatStr LITERAL1
kHiStr LITERAL1
kHigh LITERAL1
kHighNibble LITERAL1
kHighStr LITERAL1
kHighest LITERAL1
kHighestStr LITERAL1
kHitachiAc1Bits LITERAL1
kHitachiAc1HdrMark LITERAL1
kHitachiAc1HdrSpace LITERAL1
@ -1875,6 +1921,12 @@ kHitachiAc2Bits LITERAL1
kHitachiAc2StateLength LITERAL1
kHitachiAc424BitMark LITERAL1
kHitachiAc424Bits LITERAL1
kHitachiAc424ButtonByte LITERAL1
kHitachiAc424ButtonFan LITERAL1
kHitachiAc424ButtonPowerMode LITERAL1
kHitachiAc424ButtonSwingV LITERAL1
kHitachiAc424ButtonTempDown LITERAL1
kHitachiAc424ButtonTempUp LITERAL1
kHitachiAc424Cool LITERAL1
kHitachiAc424Dry LITERAL1
kHitachiAc424Fan LITERAL1
@ -1897,7 +1949,8 @@ kHitachiAc424MinTemp LITERAL1
kHitachiAc424ModeByte LITERAL1
kHitachiAc424OneSpace LITERAL1
kHitachiAc424PowerByte LITERAL1
kHitachiAc424PowerOffset LITERAL1
kHitachiAc424PowerOff LITERAL1
kHitachiAc424PowerOn LITERAL1
kHitachiAc424StateLength LITERAL1
kHitachiAc424TempByte LITERAL1
kHitachiAc424TempOffset LITERAL1
@ -1927,6 +1980,11 @@ kHitachiAcPowerOffset LITERAL1
kHitachiAcStateLength LITERAL1
kHitachiAcSwingOffset LITERAL1
kHitachiAcZeroSpace LITERAL1
kHoldStr LITERAL1
kHourStr LITERAL1
kHoursStr LITERAL1
kHumidStr LITERAL1
kIFeelStr LITERAL1
kIdleState LITERAL1
kInaxBitMark LITERAL1
kInaxBits LITERAL1
@ -1937,6 +1995,7 @@ kInaxMinRepeat LITERAL1
kInaxOneSpace LITERAL1
kInaxTick LITERAL1
kInaxZeroSpace LITERAL1
kIonStr LITERAL1
kJvcBitMark LITERAL1
kJvcBitMarkTicks LITERAL1
kJvcBits LITERAL1
@ -2008,10 +2067,13 @@ kLasertagTolerance LITERAL1
kLastDecodeType LITERAL1
kLastFanspeedEnum LITERAL1
kLastOpmodeEnum LITERAL1
kLastStr LITERAL1
kLastSwinghEnum LITERAL1
kLastSwingvEnum LITERAL1
kLeft LITERAL1
kLeftMax LITERAL1
kLeftMaxStr LITERAL1
kLeftStr LITERAL1
kLegoPfBitMark LITERAL1
kLegoPfBits LITERAL1
kLegoPfHdrSpace LITERAL1
@ -2050,9 +2112,16 @@ kLgRptSpaceTicks LITERAL1
kLgTick LITERAL1
kLgZeroSpace LITERAL1
kLgZeroSpaceTicks LITERAL1
kLightStr LITERAL1
kLightToggleStr LITERAL1
kLoStr LITERAL1
kLoudStr LITERAL1
kLow LITERAL1
kLowNibble LITERAL1
kLowStr LITERAL1
kLowerStr LITERAL1
kLowest LITERAL1
kLowestStr LITERAL1
kLutronBits LITERAL1
kLutronDelta LITERAL1
kLutronGap LITERAL1
@ -2073,14 +2142,23 @@ kMagiQuestSpaceZero LITERAL1
kMagiQuestTotalUsec LITERAL1
kMagiQuestZeroRatio LITERAL1
kMagiquestBits LITERAL1
kManualStr LITERAL1
kMark LITERAL1
kMarkExcess LITERAL1
kMarkState LITERAL1
kMax LITERAL1
kMaxAccurateUsecDelay LITERAL1
kMaxLeftStr LITERAL1
kMaxRightStr LITERAL1
kMaxStr LITERAL1
kMaxTimeoutMs LITERAL1
kMaximumStr LITERAL1
kMedStr LITERAL1
kMedium LITERAL1
kMediumStr LITERAL1
kMidStr LITERAL1
kMiddle LITERAL1
kMiddleStr LITERAL1
kMideaACAuto LITERAL1
kMideaACCelsiusOffset LITERAL1
kMideaACCool LITERAL1
@ -2120,6 +2198,10 @@ kMideaTolerance LITERAL1
kMideaZeroSpace LITERAL1
kMideaZeroSpaceTicks LITERAL1
kMin LITERAL1
kMinStr LITERAL1
kMinimumStr LITERAL1
kMinuteStr LITERAL1
kMinutesStr LITERAL1
kMitsubishi112Auto LITERAL1
kMitsubishi112BitMark LITERAL1
kMitsubishi112Bits LITERAL1
@ -2350,6 +2432,11 @@ kMitsubishiTick LITERAL1
kMitsubishiZeroSpace LITERAL1
kMitsubishiZeroSpaceTicks LITERAL1
kModeBitsSize LITERAL1
kModeStr LITERAL1
kModelStr LITERAL1
kMouldStr LITERAL1
kMoveStr LITERAL1
kNAStr LITERAL1
kNECBits LITERAL1
kNecBitMark LITERAL1
kNecBitMarkTicks LITERAL1
@ -2428,6 +2515,7 @@ kNeoclimaTempSize LITERAL1
kNeoclimaTurboOffset LITERAL1
kNeoclimaZeroSpace LITERAL1
kNibbleSize LITERAL1
kNightStr LITERAL1
kNikaiBitMark LITERAL1
kNikaiBitMarkTicks LITERAL1
kNikaiBits LITERAL1
@ -2443,7 +2531,15 @@ kNikaiTick LITERAL1
kNikaiZeroSpace LITERAL1
kNikaiZeroSpaceTicks LITERAL1
kNoRepeat LITERAL1
kNoStr LITERAL1
kNowStr LITERAL1
kOff LITERAL1
kOffStr LITERAL1
kOffTimerStr LITERAL1
kOnStr LITERAL1
kOnTimerStr LITERAL1
kOutsideQuietStr LITERAL1
kOutsideStr LITERAL1
kPanasonicAcAuto LITERAL1
kPanasonicAcBits LITERAL1
kPanasonicAcChecksumInit LITERAL1
@ -2537,6 +2633,9 @@ kPioneerOneSpaceTicks LITERAL1
kPioneerTick LITERAL1
kPioneerZeroSpace LITERAL1
kPioneerZeroSpaceTicks LITERAL1
kPowerStr LITERAL1
kPowerToggleStr LITERAL1
kPowerfulStr LITERAL1
kProntoDataOffset LITERAL1
kProntoFreqFactor LITERAL1
kProntoFreqOffset LITERAL1
@ -2544,6 +2643,9 @@ kProntoMinLength LITERAL1
kProntoSeq1LenOffset LITERAL1
kProntoSeq2LenOffset LITERAL1
kProntoTypeOffset LITERAL1
kProtocolStr LITERAL1
kPurifyStr LITERAL1
kQuietStr LITERAL1
kRC5Bits LITERAL1
kRC5RawBits LITERAL1
kRC5XBits LITERAL1
@ -2588,8 +2690,12 @@ kRcmmRptLengthTicks LITERAL1
kRcmmTick LITERAL1
kRcmmTolerance LITERAL1
kRepeat LITERAL1
kRepeatStr LITERAL1
kRight LITERAL1
kRightMax LITERAL1
kRightMaxStr LITERAL1
kRightStr LITERAL1
kRoomStr LITERAL1
kSamsung36Bits LITERAL1
kSamsungACSectionLength LITERAL1
kSamsungAcAuto LITERAL1
@ -2676,6 +2782,12 @@ kSanyoSa8650bHdrSpace LITERAL1
kSanyoSa8650bOneMark LITERAL1
kSanyoSa8650bRptLength LITERAL1
kSanyoSa8650bZeroMark LITERAL1
kSaveStr LITERAL1
kSecondStr LITERAL1
kSecondsStr LITERAL1
kSensorStr LITERAL1
kSensorTempStr LITERAL1
kSetStr LITERAL1
kSharpAcAuto LITERAL1
kSharpAcBitFanManualOffset LITERAL1
kSharpAcBitMark LITERAL1
@ -2725,7 +2837,11 @@ kSharpZeroSpace LITERAL1
kSharpZeroSpaceTicks LITERAL1
kSherwoodBits LITERAL1
kSherwoodMinRepeat LITERAL1
kSilentStr LITERAL1
kSingleRepeat LITERAL1
kSleepStr LITERAL1
kSleepTimerStr LITERAL1
kSlowStr LITERAL1
kSony12Bits LITERAL1
kSony15Bits LITERAL1
kSony20Bits LITERAL1
@ -2745,10 +2861,20 @@ kSonyTick LITERAL1
kSonyZeroMark LITERAL1
kSonyZeroMarkTicks LITERAL1
kSpace LITERAL1
kSpaceLBraceStr LITERAL1
kSpaceState LITERAL1
kStartOffset LITERAL1
kStartStr LITERAL1
kStateSizeMax LITERAL1
kStepStr LITERAL1
kStopState LITERAL1
kStopStr LITERAL1
kSuperStr LITERAL1
kSwingHStr LITERAL1
kSwingStr LITERAL1
kSwingVModeStr LITERAL1
kSwingVStr LITERAL1
kSwingVToggleStr LITERAL1
kTcl112AcAuto LITERAL1
kTcl112AcBitEconoOffset LITERAL1
kTcl112AcBitHealthOffset LITERAL1
@ -2821,8 +2947,15 @@ kTecoTimerTensHoursSize LITERAL1
kTecoTimerUnitHoursOffset LITERAL1
kTecoTimerUnitHoursSize LITERAL1
kTecoZeroSpace LITERAL1
kTempDownStr LITERAL1
kTempStr LITERAL1
kTempUpStr LITERAL1
kThreeLetterDayOfWeekStr LITERAL1
kTimeoutMs LITERAL1
kTimerStr LITERAL1
kToggleStr LITERAL1
kTolerance LITERAL1
kTopStr LITERAL1
kToshibaACBits LITERAL1
kToshibaACMinRepeat LITERAL1
kToshibaACStateLength LITERAL1
@ -2881,7 +3014,12 @@ kTrotecTempOffset LITERAL1
kTrotecTempSize LITERAL1
kTrotecTimerBitOffset LITERAL1
kTrotecZeroSpace LITERAL1
kTrueStr LITERAL1
kTurboStr LITERAL1
kUnknownStr LITERAL1
kUnknownThreshold LITERAL1
kUpStr LITERAL1
kUpperStr LITERAL1
kUseDefTol LITERAL1
kVestelAcAuto LITERAL1
kVestelAcBitMark LITERAL1
@ -2934,6 +3072,8 @@ kVestelAcTolerance LITERAL1
kVestelAcTurbo LITERAL1
kVestelAcTurboSleepOffset LITERAL1
kVestelAcZeroSpace LITERAL1
kWallStr LITERAL1
kWeeklyTimerStr LITERAL1
kWhirlpoolAcAltTempOffset LITERAL1
kWhirlpoolAcAltTempPos LITERAL1
kWhirlpoolAcAuto LITERAL1
@ -3014,3 +3154,8 @@ kWhynterTick LITERAL1
kWhynterZeroSpace LITERAL1
kWhynterZeroSpaceTicks LITERAL1
kWide LITERAL1
kWideStr LITERAL1
kWifiStr LITERAL1
kXFanStr LITERAL1
kYesStr LITERAL1
kZoneFollowStr LITERAL1

View File

@ -1,6 +1,6 @@
{
"name": "IRremoteESP8266",
"version": "2.7.0",
"version": "2.7.1",
"keywords": "infrared, ir, remote, esp8266, esp32",
"description": "Send and receive infrared signals with multiple protocols (ESP8266/ESP32)",
"repository":

View File

@ -1,5 +1,5 @@
name=IRremoteESP8266
version=2.7.0
version=2.7.1
author=David Conran, Sebastien Warin, Mark Szabo, Ken Shirriff
maintainer=Mark Szabo, David Conran, Sebastien Warin, Roi Dayan, Massimiliano Pinto
sentence=Send and receive infrared signals with multiple protocols (ESP8266/ESP32)

View File

@ -670,13 +670,15 @@ void IRac::hitachi(IRHitachiAc *ac,
#if SEND_HITACHI_AC424
void IRac::hitachi424(IRHitachiAc424 *ac,
const bool on, const stdAc::opmode_t mode,
const float degrees, const stdAc::fanspeed_t fan) {
const float degrees, const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv) {
ac->begin();
ac->setPower(on);
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees);
ac->setFan(ac->convertFan(fan));
// TODO(jamsinclair): Add Swing(V) support.
ac->setPower(on);
// SwingVToggle is special. Needs to be last method called.
ac->setSwingVToggle(swingv != stdAc::swingv_t::kOff);
// No Swing(H) setting available.
// No Quiet setting available.
// No Turbo setting available.
@ -1174,6 +1176,7 @@ stdAc::state_t IRac::handleToggles(const stdAc::state_t desired,
result.light = desired.light ^ prev->light;
break;
case decode_type_t::MIDEA:
case decode_type_t::HITACHI_AC424:
if ((desired.swingv == stdAc::swingv_t::kOff) ^
(prev->swingv == stdAc::swingv_t::kOff)) // It changed, so toggle.
result.swingv = stdAc::swingv_t::kAuto;
@ -1413,7 +1416,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
case HITACHI_AC424:
{
IRHitachiAc424 ac(_pin, _inverted, _modulation);
hitachi424(&ac, on, send.mode, degC, send.fanspeed);
hitachi424(&ac, on, send.mode, degC, send.fanspeed, send.swingv);
break;
}
#endif // SEND_HITACHI_AC424
@ -1601,25 +1604,25 @@ bool IRac::hasStateChanged(void) { return cmpStates(next, _prev); }
stdAc::opmode_t IRac::strToOpmode(const char *str,
const stdAc::opmode_t def) {
if (!strcasecmp(str, kAutoStr.c_str()) ||
!strcasecmp(str, kAutomaticStr.c_str()))
if (!strcasecmp(str, kAutoStr) ||
!strcasecmp(str, kAutomaticStr))
return stdAc::opmode_t::kAuto;
else if (!strcasecmp(str, kOffStr.c_str()) ||
!strcasecmp(str, kStopStr.c_str()))
else if (!strcasecmp(str, kOffStr) ||
!strcasecmp(str, kStopStr))
return stdAc::opmode_t::kOff;
else if (!strcasecmp(str, kCoolStr.c_str()) ||
else if (!strcasecmp(str, kCoolStr) ||
!strcasecmp(str, "COOLING"))
return stdAc::opmode_t::kCool;
else if (!strcasecmp(str, kHeatStr.c_str()) ||
else if (!strcasecmp(str, kHeatStr) ||
!strcasecmp(str, "HEATING"))
return stdAc::opmode_t::kHeat;
else if (!strcasecmp(str, kDryStr.c_str()) ||
else if (!strcasecmp(str, kDryStr) ||
!strcasecmp(str, "DRYING") ||
!strcasecmp(str, "DEHUMIDIFY"))
return stdAc::opmode_t::kDry;
else if (!strcasecmp(str, kFanStr.c_str()) ||
else if (!strcasecmp(str, kFanStr) ||
!strcasecmp(str, "FANONLY") ||
!strcasecmp(str, kFanOnlyStr.c_str()))
!strcasecmp(str, kFanOnlyStr))
return stdAc::opmode_t::kFan;
else
return def;
@ -1627,26 +1630,26 @@ stdAc::opmode_t IRac::strToOpmode(const char *str,
stdAc::fanspeed_t IRac::strToFanspeed(const char *str,
const stdAc::fanspeed_t def) {
if (!strcasecmp(str, kAutoStr.c_str()) ||
!strcasecmp(str, kAutomaticStr.c_str()))
if (!strcasecmp(str, kAutoStr) ||
!strcasecmp(str, kAutomaticStr))
return stdAc::fanspeed_t::kAuto;
else if (!strcasecmp(str, kMinStr.c_str()) ||
!strcasecmp(str, kMinimumStr.c_str()) ||
!strcasecmp(str, kLowestStr.c_str()))
else if (!strcasecmp(str, kMinStr) ||
!strcasecmp(str, kMinimumStr) ||
!strcasecmp(str, kLowestStr))
return stdAc::fanspeed_t::kMin;
else if (!strcasecmp(str, kLowStr.c_str()) ||
!strcasecmp(str, kLoStr.c_str()))
else if (!strcasecmp(str, kLowStr) ||
!strcasecmp(str, kLoStr))
return stdAc::fanspeed_t::kLow;
else if (!strcasecmp(str, kMedStr.c_str()) ||
!strcasecmp(str, kMediumStr.c_str()) ||
!strcasecmp(str, kMidStr.c_str()))
else if (!strcasecmp(str, kMedStr) ||
!strcasecmp(str, kMediumStr) ||
!strcasecmp(str, kMidStr))
return stdAc::fanspeed_t::kMedium;
else if (!strcasecmp(str, kHighStr.c_str()) ||
!strcasecmp(str, kHiStr.c_str()))
else if (!strcasecmp(str, kHighStr) ||
!strcasecmp(str, kHiStr))
return stdAc::fanspeed_t::kHigh;
else if (!strcasecmp(str, kMaxStr.c_str()) ||
!strcasecmp(str, kMaximumStr.c_str()) ||
!strcasecmp(str, kHighestStr.c_str()))
else if (!strcasecmp(str, kMaxStr) ||
!strcasecmp(str, kMaximumStr) ||
!strcasecmp(str, kHighestStr))
return stdAc::fanspeed_t::kMax;
else
return def;
@ -1654,36 +1657,36 @@ stdAc::fanspeed_t IRac::strToFanspeed(const char *str,
stdAc::swingv_t IRac::strToSwingV(const char *str,
const stdAc::swingv_t def) {
if (!strcasecmp(str, kAutoStr.c_str()) ||
!strcasecmp(str, kAutomaticStr.c_str()) ||
!strcasecmp(str, kOnStr.c_str()) ||
!strcasecmp(str, kSwingStr.c_str()))
if (!strcasecmp(str, kAutoStr) ||
!strcasecmp(str, kAutomaticStr) ||
!strcasecmp(str, kOnStr) ||
!strcasecmp(str, kSwingStr))
return stdAc::swingv_t::kAuto;
else if (!strcasecmp(str, kOffStr.c_str()) ||
!strcasecmp(str, kStopStr.c_str()))
else if (!strcasecmp(str, kOffStr) ||
!strcasecmp(str, kStopStr))
return stdAc::swingv_t::kOff;
else if (!strcasecmp(str, kMinStr.c_str()) ||
!strcasecmp(str, kMinimumStr.c_str()) ||
!strcasecmp(str, kLowestStr.c_str()) ||
!strcasecmp(str, kBottomStr.c_str()) ||
!strcasecmp(str, kDownStr.c_str()))
else if (!strcasecmp(str, kMinStr) ||
!strcasecmp(str, kMinimumStr) ||
!strcasecmp(str, kLowestStr) ||
!strcasecmp(str, kBottomStr) ||
!strcasecmp(str, kDownStr))
return stdAc::swingv_t::kLowest;
else if (!strcasecmp(str, kLowStr.c_str()))
else if (!strcasecmp(str, kLowStr))
return stdAc::swingv_t::kLow;
else if (!strcasecmp(str, kMidStr.c_str()) ||
!strcasecmp(str, kMiddleStr.c_str()) ||
!strcasecmp(str, kMedStr.c_str()) ||
!strcasecmp(str, kMediumStr.c_str()) ||
!strcasecmp(str, kCentreStr.c_str()))
else if (!strcasecmp(str, kMidStr) ||
!strcasecmp(str, kMiddleStr) ||
!strcasecmp(str, kMedStr) ||
!strcasecmp(str, kMediumStr) ||
!strcasecmp(str, kCentreStr))
return stdAc::swingv_t::kMiddle;
else if (!strcasecmp(str, kHighStr.c_str()) ||
!strcasecmp(str, kHiStr.c_str()))
else if (!strcasecmp(str, kHighStr) ||
!strcasecmp(str, kHiStr))
return stdAc::swingv_t::kHigh;
else if (!strcasecmp(str, kHighestStr.c_str()) ||
!strcasecmp(str, kMaxStr.c_str()) ||
!strcasecmp(str, kMaximumStr.c_str()) ||
!strcasecmp(str, kTopStr.c_str()) ||
!strcasecmp(str, kUpStr.c_str()))
else if (!strcasecmp(str, kHighestStr) ||
!strcasecmp(str, kMaxStr) ||
!strcasecmp(str, kMaximumStr) ||
!strcasecmp(str, kTopStr) ||
!strcasecmp(str, kUpStr))
return stdAc::swingv_t::kHighest;
else
return def;
@ -1691,34 +1694,34 @@ stdAc::swingv_t IRac::strToSwingV(const char *str,
stdAc::swingh_t IRac::strToSwingH(const char *str,
const stdAc::swingh_t def) {
if (!strcasecmp(str, kAutoStr.c_str()) ||
!strcasecmp(str, kAutomaticStr.c_str()) ||
!strcasecmp(str, kOnStr.c_str()) || !strcasecmp(str, kSwingStr.c_str()))
if (!strcasecmp(str, kAutoStr) ||
!strcasecmp(str, kAutomaticStr) ||
!strcasecmp(str, kOnStr) || !strcasecmp(str, kSwingStr))
return stdAc::swingh_t::kAuto;
else if (!strcasecmp(str, kOffStr.c_str()) ||
!strcasecmp(str, kStopStr.c_str()))
else if (!strcasecmp(str, kOffStr) ||
!strcasecmp(str, kStopStr))
return stdAc::swingh_t::kOff;
else if (!strcasecmp(str, kLeftMaxStr.c_str()) ||
else if (!strcasecmp(str, kLeftMaxStr) ||
!strcasecmp(str, D_STR_LEFT " " D_STR_MAX) ||
!strcasecmp(str, D_STR_MAX D_STR_LEFT) ||
!strcasecmp(str, kMaxLeftStr.c_str()))
!strcasecmp(str, kMaxLeftStr))
return stdAc::swingh_t::kLeftMax;
else if (!strcasecmp(str, kLeftStr.c_str()))
else if (!strcasecmp(str, kLeftStr))
return stdAc::swingh_t::kLeft;
else if (!strcasecmp(str, kMidStr.c_str()) ||
!strcasecmp(str, kMiddleStr.c_str()) ||
!strcasecmp(str, kMedStr.c_str()) ||
!strcasecmp(str, kMediumStr.c_str()) ||
!strcasecmp(str, kCentreStr.c_str()))
else if (!strcasecmp(str, kMidStr) ||
!strcasecmp(str, kMiddleStr) ||
!strcasecmp(str, kMedStr) ||
!strcasecmp(str, kMediumStr) ||
!strcasecmp(str, kCentreStr))
return stdAc::swingh_t::kMiddle;
else if (!strcasecmp(str, kRightStr.c_str()))
else if (!strcasecmp(str, kRightStr))
return stdAc::swingh_t::kRight;
else if (!strcasecmp(str, kRightMaxStr.c_str()) ||
else if (!strcasecmp(str, kRightMaxStr) ||
!strcasecmp(str, D_STR_MAX " " D_STR_RIGHT) ||
!strcasecmp(str, D_STR_MAX D_STR_RIGHT) ||
!strcasecmp(str, kMaxRightStr.c_str()))
!strcasecmp(str, kMaxRightStr))
return stdAc::swingh_t::kRightMax;
else if (!strcasecmp(str, kWideStr.c_str()))
else if (!strcasecmp(str, kWideStr))
return stdAc::swingh_t::kWide;
else
return def;
@ -1771,15 +1774,15 @@ int16_t IRac::strToModel(const char *str, const int16_t def) {
}
bool IRac::strToBool(const char *str, const bool def) {
if (!strcasecmp(str, kOnStr.c_str()) ||
if (!strcasecmp(str, kOnStr) ||
!strcasecmp(str, "1") ||
!strcasecmp(str, kYesStr.c_str()) ||
!strcasecmp(str, kTrueStr.c_str()))
!strcasecmp(str, kYesStr) ||
!strcasecmp(str, kTrueStr))
return true;
else if (!strcasecmp(str, kOffStr.c_str()) ||
else if (!strcasecmp(str, kOffStr) ||
!strcasecmp(str, "0") ||
!strcasecmp(str, kNoStr.c_str()) ||
!strcasecmp(str, kFalseStr.c_str()))
!strcasecmp(str, kNoStr) ||
!strcasecmp(str, kFalseStr))
return false;
else
return def;

View File

@ -219,7 +219,8 @@ void electra(IRElectraAc *ac,
#if SEND_HITACHI_AC424
void hitachi424(IRHitachiAc424 *ac,
const bool on, const stdAc::opmode_t mode,
const float degrees, const stdAc::fanspeed_t fan);
const float degrees, const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv);
#endif // SEND_HITACHI_AC424
#if SEND_KELVINATOR
void kelvinator(IRKelvinatorAC *ac,

View File

@ -1,4 +1,4 @@
/***************************************************
/***************************************************
* IRremote for ESP8266
*
* Based on the IRremote library for Arduino by Ken Shirriff
@ -52,7 +52,7 @@
#endif // UNIT_TEST
// Library Version
#define _IRREMOTEESP8266_VERSION_ "2.7.0"
#define _IRREMOTEESP8266_VERSION_ "2.7.1"
// Set the language & locale for the library. See the `locale` dir for options.
#ifndef _IR_LOCALE_

View File

@ -0,0 +1,164 @@
// Copyright 2019 - David Conran (@crankyoldgit)
#ifndef UNIT_TEST
#include <Arduino.h>
#endif // UNIT_TEST
#include "IRremoteESP8266.h"
#include "i18n.h"
#ifndef PROGMEM
#define PROGMEM // Pretend we have the PROGMEM macro even if we really don't.
#endif
// Common
const PROGMEM char* kUnknownStr = D_STR_UNKNOWN;
const PROGMEM char* kProtocolStr = D_STR_PROTOCOL;
const PROGMEM char* kPowerStr = D_STR_POWER;
const PROGMEM char* kOnStr = D_STR_ON;
const PROGMEM char* kOffStr = D_STR_OFF;
const PROGMEM char* kModeStr = D_STR_MODE;
const PROGMEM char* kToggleStr = D_STR_TOGGLE;
const PROGMEM char* kTurboStr = D_STR_TURBO;
const PROGMEM char* kSuperStr = D_STR_SUPER;
const PROGMEM char* kSleepStr = D_STR_SLEEP;
const PROGMEM char* kLightStr = D_STR_LIGHT;
const PROGMEM char* kPowerfulStr = D_STR_POWERFUL;
const PROGMEM char* kQuietStr = D_STR_QUIET;
const PROGMEM char* kEconoStr = D_STR_ECONO;
const PROGMEM char* kSwingStr = D_STR_SWING;
const PROGMEM char* kSwingHStr = D_STR_SWINGH;
const PROGMEM char* kSwingVStr = D_STR_SWINGV;
const PROGMEM char* kBeepStr = D_STR_BEEP;
const PROGMEM char* kZoneFollowStr = D_STR_ZONEFOLLOW;
const PROGMEM char* kFixedStr = D_STR_FIXED;
const PROGMEM char* kMouldStr = D_STR_MOULD;
const PROGMEM char* kCleanStr = D_STR_CLEAN;
const PROGMEM char* kPurifyStr = D_STR_PURIFY;
const PROGMEM char* kTimerStr = D_STR_TIMER;
const PROGMEM char* kOnTimerStr = D_STR_ONTIMER;
const PROGMEM char* kOffTimerStr = D_STR_OFFTIMER;
const PROGMEM char* kClockStr = D_STR_CLOCK;
const PROGMEM char* kCommandStr = D_STR_COMMAND;
const PROGMEM char* kXFanStr = D_STR_XFAN;
const PROGMEM char* kHealthStr = D_STR_HEALTH;
const PROGMEM char* kModelStr = D_STR_MODEL;
const PROGMEM char* kTempStr = D_STR_TEMP;
const PROGMEM char* kIFeelStr = D_STR_IFEEL;
const PROGMEM char* kHumidStr = D_STR_HUMID;
const PROGMEM char* kSaveStr = D_STR_SAVE;
const PROGMEM char* kEyeStr = D_STR_EYE;
const PROGMEM char* kFollowStr = D_STR_FOLLOW;
const PROGMEM char* kIonStr = D_STR_ION;
const PROGMEM char* kFreshStr = D_STR_FRESH;
const PROGMEM char* kHoldStr = D_STR_HOLD;
const PROGMEM char* kButtonStr = D_STR_BUTTON;
const PROGMEM char* k8CHeatStr = D_STR_8C_HEAT;
const PROGMEM char* kNightStr = D_STR_NIGHT;
const PROGMEM char* kSilentStr = D_STR_SILENT;
const PROGMEM char* kFilterStr = D_STR_FILTER;
const PROGMEM char* k3DStr = D_STR_3D;
const PROGMEM char* kCelsiusStr = D_STR_CELSIUS;
const PROGMEM char* kTempUpStr = D_STR_TEMPUP;
const PROGMEM char* kTempDownStr = D_STR_TEMPDOWN;
const PROGMEM char* kStartStr = D_STR_START;
const PROGMEM char* kStopStr = D_STR_STOP;
const PROGMEM char* kMoveStr = D_STR_MOVE;
const PROGMEM char* kSetStr = D_STR_SET;
const PROGMEM char* kCancelStr = D_STR_CANCEL;
const PROGMEM char* kUpStr = D_STR_UP;
const PROGMEM char* kDownStr = D_STR_DOWN;
const PROGMEM char* kChangeStr = D_STR_CHANGE;
const PROGMEM char* kComfortStr = D_STR_COMFORT;
const PROGMEM char* kSensorStr = D_STR_SENSOR;
const PROGMEM char* kWeeklyTimerStr = D_STR_WEEKLYTIMER;
const PROGMEM char* kWifiStr = D_STR_WIFI;
const PROGMEM char* kLastStr = D_STR_LAST;
const PROGMEM char* kFastStr = D_STR_FAST;
const PROGMEM char* kSlowStr = D_STR_SLOW;
const PROGMEM char* kAirFlowStr = D_STR_AIRFLOW;
const PROGMEM char* kStepStr = D_STR_STEP;
const PROGMEM char* kNAStr = D_STR_NA;
const PROGMEM char* kOutsideStr = D_STR_OUTSIDE;
const PROGMEM char* kLoudStr = D_STR_LOUD;
const PROGMEM char* kLowerStr = D_STR_LOWER;
const PROGMEM char* kUpperStr = D_STR_UPPER;
const PROGMEM char* kBreezeStr = D_STR_BREEZE;
const PROGMEM char* kCirculateStr = D_STR_CIRCULATE;
const PROGMEM char* kCeilingStr = D_STR_CEILING;
const PROGMEM char* kWallStr = D_STR_WALL;
const PROGMEM char* kRoomStr = D_STR_ROOM;
const PROGMEM char* k6thSenseStr = D_STR_6THSENSE;
const PROGMEM char* kAutoStr = D_STR_AUTO;
const PROGMEM char* kAutomaticStr = D_STR_AUTOMATIC;
const PROGMEM char* kManualStr = D_STR_MANUAL;
const PROGMEM char* kCoolStr = D_STR_COOL;
const PROGMEM char* kHeatStr = D_STR_HEAT;
const PROGMEM char* kFanStr = D_STR_FAN;
const PROGMEM char* kDryStr = D_STR_DRY;
const PROGMEM char* kFanOnlyStr = D_STR_FANONLY;
const PROGMEM char* kMaxStr = D_STR_MAX;
const PROGMEM char* kMaximumStr = D_STR_MAXIMUM;
const PROGMEM char* kMinStr = D_STR_MIN;
const PROGMEM char* kMinimumStr = D_STR_MINIMUM;
const PROGMEM char* kMedStr = D_STR_MED;
const PROGMEM char* kMediumStr = D_STR_MEDIUM;
const PROGMEM char* kHighestStr = D_STR_HIGHEST;
const PROGMEM char* kHighStr = D_STR_HIGH;
const PROGMEM char* kHiStr = D_STR_HI;
const PROGMEM char* kMidStr = D_STR_MID;
const PROGMEM char* kMiddleStr = D_STR_MIDDLE;
const PROGMEM char* kLowStr = D_STR_LOW;
const PROGMEM char* kLoStr = D_STR_LO;
const PROGMEM char* kLowestStr = D_STR_LOWEST;
const PROGMEM char* kMaxRightStr = D_STR_MAXRIGHT;
const PROGMEM char* kRightMaxStr = D_STR_RIGHTMAX_NOSPACE;
const PROGMEM char* kRightStr = D_STR_RIGHT;
const PROGMEM char* kLeftStr = D_STR_LEFT;
const PROGMEM char* kMaxLeftStr = D_STR_MAXLEFT;
const PROGMEM char* kLeftMaxStr = D_STR_LEFTMAX_NOSPACE;
const PROGMEM char* kWideStr = D_STR_WIDE;
const PROGMEM char* kCentreStr = D_STR_CENTRE;
const PROGMEM char* kTopStr = D_STR_TOP;
const PROGMEM char* kBottomStr = D_STR_BOTTOM;
// Compound words/phrases/descriptions from pre-defined words.
const PROGMEM char* kEyeAutoStr = D_STR_EYEAUTO;
const PROGMEM char* kLightToggleStr = D_STR_LIGHTTOGGLE;
const PROGMEM char* kOutsideQuietStr = D_STR_OUTSIDEQUIET;
const PROGMEM char* kPowerToggleStr = D_STR_POWERTOGGLE;
const PROGMEM char* kSensorTempStr = D_STR_SENSORTEMP;
const PROGMEM char* kSleepTimerStr = D_STR_SLEEP_TIMER;
const PROGMEM char* kSwingVModeStr = D_STR_SWINGVMODE;
const PROGMEM char* kSwingVToggleStr = D_STR_SWINGVTOGGLE;
// Separators
char kTimeSep = D_CHR_TIME_SEP;
const PROGMEM char* kSpaceLBraceStr = D_STR_SPACELBRACE;
const PROGMEM char* kCommaSpaceStr = D_STR_COMMASPACE;
const PROGMEM char* kColonSpaceStr = D_STR_COLONSPACE;
// IRutils
// - Time
const PROGMEM char* kDayStr = D_STR_DAY;
const PROGMEM char* kDaysStr = D_STR_DAYS;
const PROGMEM char* kHourStr = D_STR_HOUR;
const PROGMEM char* kHoursStr = D_STR_HOURS;
const PROGMEM char* kMinuteStr = D_STR_MINUTE;
const PROGMEM char* kMinutesStr = D_STR_MINUTES;
const PROGMEM char* kSecondStr = D_STR_SECOND;
const PROGMEM char* kSecondsStr = D_STR_SECONDS;
const PROGMEM char* kNowStr = D_STR_NOW;
const PROGMEM char* kThreeLetterDayOfWeekStr = D_STR_THREELETTERDAYS;
const PROGMEM char* kYesStr = D_STR_YES;
const PROGMEM char* kNoStr = D_STR_NO;
const PROGMEM char* kTrueStr = D_STR_TRUE;
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;

View File

@ -0,0 +1,154 @@
// Copyright 2019 - David Conran (@crankyoldgit)
// This header file is to be included in files **other than** 'IRtext.cpp'.
//
// WARNING: Do not edit this file! This file is automatically generated by
// 'tools/generate_irtext_h.sh'.
#ifndef IRTEXT_H_
#define IRTEXT_H_
#include "i18n.h"
// Constant text to be shared across all object files.
// This means there is only one copy of the character/string/text etc.
extern char kTimeSep;
extern const char* k3DStr;
extern const char* k6thSenseStr;
extern const char* k8CHeatStr;
extern const char* kAirFlowStr;
extern const char* kAutomaticStr;
extern const char* kAutoStr;
extern const char* kBeepStr;
extern const char* kBitsStr;
extern const char* kBottomStr;
extern const char* kBreezeStr;
extern const char* kButtonStr;
extern const char* kCancelStr;
extern const char* kCeilingStr;
extern const char* kCelsiusStr;
extern const char* kCentreStr;
extern const char* kChangeStr;
extern const char* kCirculateStr;
extern const char* kCleanStr;
extern const char* kClockStr;
extern const char* kCodeStr;
extern const char* kColonSpaceStr;
extern const char* kComfortStr;
extern const char* kCommandStr;
extern const char* kCommaSpaceStr;
extern const char* kCoolStr;
extern const char* kDaysStr;
extern const char* kDayStr;
extern const char* kDownStr;
extern const char* kDryStr;
extern const char* kEconoStr;
extern const char* kEyeAutoStr;
extern const char* kEyeStr;
extern const char* kFalseStr;
extern const char* kFanOnlyStr;
extern const char* kFanStr;
extern const char* kFastStr;
extern const char* kFilterStr;
extern const char* kFixedStr;
extern const char* kFollowStr;
extern const char* kFreshStr;
extern const char* kHealthStr;
extern const char* kHeatStr;
extern const char* kHighestStr;
extern const char* kHighStr;
extern const char* kHiStr;
extern const char* kHoldStr;
extern const char* kHoursStr;
extern const char* kHourStr;
extern const char* kHumidStr;
extern const char* kIFeelStr;
extern const char* kIonStr;
extern const char* kLastStr;
extern const char* kLeftMaxStr;
extern const char* kLeftStr;
extern const char* kLightStr;
extern const char* kLightToggleStr;
extern const char* kLoStr;
extern const char* kLoudStr;
extern const char* kLowerStr;
extern const char* kLowestStr;
extern const char* kLowStr;
extern const char* kManualStr;
extern const char* kMaximumStr;
extern const char* kMaxLeftStr;
extern const char* kMaxRightStr;
extern const char* kMaxStr;
extern const char* kMediumStr;
extern const char* kMedStr;
extern const char* kMiddleStr;
extern const char* kMidStr;
extern const char* kMinimumStr;
extern const char* kMinStr;
extern const char* kMinutesStr;
extern const char* kMinuteStr;
extern const char* kModelStr;
extern const char* kModeStr;
extern const char* kMouldStr;
extern const char* kMoveStr;
extern const char* kNAStr;
extern const char* kNightStr;
extern const char* kNoStr;
extern const char* kNowStr;
extern const char* kOffStr;
extern const char* kOffTimerStr;
extern const char* kOnStr;
extern const char* kOnTimerStr;
extern const char* kOutsideQuietStr;
extern const char* kOutsideStr;
extern const char* kPowerfulStr;
extern const char* kPowerStr;
extern const char* kPowerToggleStr;
extern const char* kProtocolStr;
extern const char* kPurifyStr;
extern const char* kQuietStr;
extern const char* kRepeatStr;
extern const char* kRightMaxStr;
extern const char* kRightStr;
extern const char* kRoomStr;
extern const char* kSaveStr;
extern const char* kSecondsStr;
extern const char* kSecondStr;
extern const char* kSensorStr;
extern const char* kSensorTempStr;
extern const char* kSetStr;
extern const char* kSilentStr;
extern const char* kSleepStr;
extern const char* kSleepTimerStr;
extern const char* kSlowStr;
extern const char* kSpaceLBraceStr;
extern const char* kStartStr;
extern const char* kStepStr;
extern const char* kStopStr;
extern const char* kSuperStr;
extern const char* kSwingHStr;
extern const char* kSwingStr;
extern const char* kSwingVModeStr;
extern const char* kSwingVStr;
extern const char* kSwingVToggleStr;
extern const char* kTempDownStr;
extern const char* kTempStr;
extern const char* kTempUpStr;
extern const char* kThreeLetterDayOfWeekStr;
extern const char* kTimerStr;
extern const char* kToggleStr;
extern const char* kTopStr;
extern const char* kTrueStr;
extern const char* kTurboStr;
extern const char* kUnknownStr;
extern const char* kUpperStr;
extern const char* kUpStr;
extern const char* kWallStr;
extern const char* kWeeklyTimerStr;
extern const char* kWideStr;
extern const char* kWifiStr;
extern const char* kXFanStr;
extern const char* kYesStr;
extern const char* kZoneFollowStr;
#endif // IRTEXT_H_

View File

@ -91,7 +91,7 @@ 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.c_str()))
if (!strcasecmp(str, kUnknownStr))
return decode_type_t::UNKNOWN;
else if (!strcasecmp(str, "UNUSED"))
return decode_type_t::UNUSED;
@ -487,7 +487,11 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) {
result = kUnknownStr;
break;
}
if (isRepeat) result += kSpaceLBraceStr + kRepeatStr + ')';
if (isRepeat) {
result += kSpaceLBraceStr;
result += kRepeatStr;
result += ')';
}
return result;
}
@ -683,16 +687,20 @@ String resultToHumanReadableBasic(const decode_results * const results) {
// Reserve some space for the string to reduce heap fragmentation.
output.reserve(2 * kStateSizeMax + 50); // Should cover most cases.
// Show Encoding standard
output += kProtocolStr + F(" : ");
output += kProtocolStr;
output += F(" : ");
output += typeToString(results->decode_type, results->repeat);
output += '\n';
// Show Code & length
output += kCodeStr + F(" : ");
output += kCodeStr;
output += F(" : ");
output += resultToHexidecimal(results);
output += kSpaceLBraceStr;
output += uint64ToString(results->bits);
output += ' ' + kBitsStr + F(")\n");
output += ' ';
output += kBitsStr;
output += F(")\n");
return output;
}
@ -891,10 +899,10 @@ namespace irutils {
result += kSpaceLBraceStr;
if ((uint8_t)(day_of_week + offset) < 7)
#if UNIT_TEST
result += kThreeLetterDayOfWeekStr.substr(
result += String(kThreeLetterDayOfWeekStr).substr(
(day_of_week + offset) * 3, 3);
#else // UNIT_TEST
result += kThreeLetterDayOfWeekStr.substring(
result += String(kThreeLetterDayOfWeekStr).substring(
(day_of_week + offset) * 3, (day_of_week + offset) * 3 + 3);
#endif // UNIT_TEST
else
@ -991,21 +999,22 @@ namespace irutils {
String result = "";
if (days)
result += uint64ToString(days) + ' ' + ((days > 1) ? kDaysStr : kDayStr);
result += uint64ToString(days) + ' ' + String((days > 1) ? kDaysStr
: kDayStr);
if (hours) {
if (result.length()) result += ' ';
result += uint64ToString(hours) + ' ' + ((hours > 1) ? kHoursStr
: kHourStr);
result += uint64ToString(hours) + ' ' + String((hours > 1) ? kHoursStr
: kHourStr);
}
if (minutes) {
if (result.length()) result += ' ';
result += uint64ToString(minutes) + ' ' + ((minutes > 1) ? kMinutesStr
: kMinuteStr);
result += uint64ToString(minutes) + ' ' + String(
(minutes > 1) ? kMinutesStr : kMinuteStr);
}
if (seconds) {
if (result.length()) result += ' ';
result += uint64ToString(seconds) + ' ' + ((seconds > 1) ? kSecondsStr
: kSecondStr);
result += uint64ToString(seconds) + ' ' + String(
(seconds > 1) ? kSecondsStr : kSecondStr);
}
return result;
}

View File

@ -332,7 +332,9 @@ String IRArgoAC::toString(void) {
result += kDryStr;
break;
case kArgoHeatAuto:
result += kHeatStr + ' ' + kAutoStr;
result += kHeatStr;
result += ' ';
result += kAutoStr;
break;
case kArgoOff:
result += kOffStr;
@ -361,7 +363,9 @@ String IRArgoAC::toString(void) {
}
result += ')';
result += addTempToString(getTemp());
result += kCommaSpaceStr + kRoomStr + ' ';
result += kCommaSpaceStr;
result += kRoomStr;
result += ' ';
result += addTempToString(getRoomTemp(), true, false);
result += addBoolToString(getMax(), kMaxStr);
result += addBoolToString(getiFeel(), kIFeelStr);

View File

@ -132,15 +132,15 @@ uint32_t IRCoolixAC::getRaw() { return remote_state; }
void IRCoolixAC::setRaw(const uint32_t new_code) {
if (!handleSpecialState(new_code)) {
// it isn`t special so might afect Temp|mode|Fan
// it isn`t special so might affect Temp|mode|Fan
if (new_code == kCoolixCmdFan) {
setMode(kCoolixFan);
} else {
// must be a command changing Temp|Mode|Fan
// it is safe to just copy to remote var
remote_state = new_code;
return;
}
}
// must be a command changing Temp|Mode|Fan
// it is safe to just copy to remote var
remote_state = new_code;
}
// Return true if the current state is a special state.
@ -243,17 +243,13 @@ bool IRCoolixAC::getPower() {
}
void IRCoolixAC::setPower(const bool on) {
if (powerFlag) {
if (!on) {
updateSavedState();
remote_state = kCoolixOff;
}
} else {
if (on) {
// at this point remote_state must be ready
// to be transmitted
recoverSavedState();
}
if (!on) {
updateSavedState();
remote_state = kCoolixOff;
} else if (!powerFlag) {
// at this point remote_state must be ready
// to be transmitted
recoverSavedState();
}
powerFlag = on;
}
@ -500,23 +496,38 @@ String IRCoolixAC::toString(void) {
if (!getPower()) return result; // If it's off, there is no other info.
// Special modes.
if (getSwing()) {
result += kCommaSpaceStr + kSwingStr + kColonSpaceStr + kToggleStr;
result += kCommaSpaceStr;
result += kSwingStr;
result += kColonSpaceStr;
result += kToggleStr;
return result;
}
if (getSleep()) {
result += kCommaSpaceStr + kSleepStr + kColonSpaceStr + kToggleStr;
result += kCommaSpaceStr;
result += kSleepStr;
result += kColonSpaceStr;
result += kToggleStr;
return result;
}
if (getTurbo()) {
result += kCommaSpaceStr + kTurboStr + kColonSpaceStr + kToggleStr;
result += kCommaSpaceStr;
result += kTurboStr;
result += kColonSpaceStr;
result += kToggleStr;
return result;
}
if (getLed()) {
result += kCommaSpaceStr + kLightStr + kColonSpaceStr + kToggleStr;
result += kCommaSpaceStr;
result += kLightStr;
result += kColonSpaceStr;
result += kToggleStr;
return result;
}
if (getClean()) {
result += kCommaSpaceStr + kCleanStr + kColonSpaceStr + kToggleStr;
result += kCommaSpaceStr;
result += kCleanStr;
result += kColonSpaceStr;
result += kToggleStr;
return result;
}
result += addModeToString(getMode(), kCoolixAuto, kCoolixCool, kCoolixHeat,
@ -528,7 +539,8 @@ String IRCoolixAC::toString(void) {
result += kAutoStr;
break;
case kCoolixFanAuto0:
result += kAutoStr + '0';
result += kAutoStr;
result += '0';
break;
case kCoolixFanMax:
result += kMaxStr;
@ -554,8 +566,7 @@ String IRCoolixAC::toString(void) {
result += addBoolToString(getZoneFollow(), kZoneFollowStr);
result += addLabeledString(
(getSensorTemp() > kCoolixSensorTempMax)
? kOffStr : uint64ToString(getSensorTemp()) + F("C"),
kSensorStr + ' ' + kTempStr);
? kOffStr : uint64ToString(getSensorTemp()) + 'C', kSensorTempStr);
return result;
}

View File

@ -1102,10 +1102,19 @@ String IRDaikin2::toString(void) {
case kDaikin2SwingVHigh:
result += kHighestStr;
break;
case 2: result += kHighStr; break;
case 3: result += kUpperStr + kMiddleStr; break;
case 4: result += kLowerStr + kMiddleStr; break;
case 5: result += kLowStr; break;
case 2:
result += kHighStr;
break;
case 3:
result += kUpperStr;
result += kMiddleStr;
break;
case 4:
result += kLowerStr;
result += kMiddleStr;
break;
case 5:
result += kLowStr;
break;
case kDaikin2SwingVLow:
result += kLowestStr;
@ -1146,7 +1155,7 @@ String IRDaikin2::toString(void) {
kOffTimerStr);
result += addLabeledString(
getSleepTimerEnabled() ? minsToString(getSleepTime()) : kOffStr,
kSleepStr + ' ' + kTimerStr);
kSleepTimerStr);
result += addIntToString(getBeep(), kBeepStr);
result += kSpaceLBraceStr;
switch (getBeep()) {
@ -1185,7 +1194,7 @@ String IRDaikin2::toString(void) {
getFreshAir() ? (getFreshAirHigh() ? kHighStr : kOnStr) : kOffStr,
kFreshStr);
result += addBoolToString(getEye(), kEyeStr);
result += addBoolToString(getEyeAuto(), kEyeStr + ' ' + kAutoStr);
result += addBoolToString(getEyeAuto(), kEyeAutoStr);
result += addBoolToString(getQuiet(), kQuietStr);
result += addBoolToString(getPowerful(), kPowerfulStr);
result += addBoolToString(getPurify(), kPurifyStr);
@ -2693,8 +2702,7 @@ uint8_t IRDaikin128::getLightToggle(void) {
String IRDaikin128::toString(void) {
String result = "";
result.reserve(240); // Reserve some heap for the string to reduce fragging.
result += addBoolToString(getPowerToggle(), kPowerStr + ' ' + kToggleStr,
false);
result += addBoolToString(getPowerToggle(), kPowerToggleStr, false);
result += addModeToString(getMode(), kDaikin128Auto, kDaikin128Cool,
kDaikin128Heat, kDaikin128Dry, kDaikin128Fan);
result += addTempToString(getTemp());
@ -2711,7 +2719,7 @@ String IRDaikin128::toString(void) {
result += addLabeledString(minsToString(getOnTimer()), kOnTimerStr);
result += addBoolToString(getOffTimerEnabled(), kOffTimerStr);
result += addLabeledString(minsToString(getOffTimer()), kOffTimerStr);
result += addIntToString(getLightToggle(), kLightStr + ' ' + kToggleStr);
result += addIntToString(getLightToggle(), kLightToggleStr);
result += kSpaceLBraceStr;
switch (getLightToggle()) {
case kDaikin128BitCeiling: result += kCeilingStr; break;

Some files were not shown because too many files have changed in this diff Show More