From e2e142f2898dfa217da5d5aaf318f0fbe07e18e7 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sun, 16 Apr 2023 23:16:28 +0200 Subject: [PATCH] Zigbee fix compilation for future core (#18432) * Zigbee fix compilation for future core * More fixes for ESP32 --- .../xdrv_23_zigbee_5_2_converters.ino | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino index 9a085787c..9d3cd4b71 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino @@ -1302,9 +1302,15 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla if (modelId.startsWith(F("lumi.sensor_cube"))) { // only for Aqara cube int32_t val = attr.getInt(); +#ifdef ESP8266 const __FlashStringHelper *aqara_cube = F("AqaraCube"); const __FlashStringHelper *aqara_cube_side = F("AqaraCubeSide"); const __FlashStringHelper *aqara_cube_from_side = F("AqaraCubeFromSide"); +#else + const char *aqara_cube = "AqaraCube"; + const char *aqara_cube_side = "AqaraCubeSide"; + const char *aqara_cube_from_side = "AqaraCubeFromSide"; +#endif switch (val) { case 0: @@ -1355,8 +1361,13 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla // presentValue = x + 512 = double tap while side x is on top } else if (modelId.startsWith(F("lumi.remote")) || modelId.startsWith(F("lumi.sensor_swit"))) { // only for Aqara buttons WXKG11LM & WXKG12LM, 'swit' because of #9923 int32_t val = attr.getInt(); +#ifdef ESP8266 const __FlashStringHelper *aqara_click = F("click"); // deprecated const __FlashStringHelper *aqara_action = F("action"); // deprecated +#else + const char *aqara_click = "click"; // deprecated + const char *aqara_action = "action"; // deprecated +#endif Z_attribute & attr_click = attr_list.addAttribute(PSTR("Click"), true); switch (val) { @@ -1408,14 +1419,14 @@ void ZCLFrame::syntheticAqaraVibration(class Z_attribute_list &attr_list, class case 0x0055: { int32_t ivalue = attr.getInt(); - const __FlashStringHelper * svalue; + const char * svalue; switch (ivalue) { - case 1: svalue = F("vibrate"); break; - case 2: svalue = F("tilt"); break; - case 3: svalue = F("drop"); break; - default: svalue = F("unknown"); break; + case 1: svalue = PSTR("vibrate"); break; + case 2: svalue = PSTR("tilt"); break; + case 3: svalue = PSTR("drop"); break; + default: svalue = PSTR("unknown"); break; } - attr.setStr((const char*)svalue); + attr.setStr(svalue); } break; case 0x0503: