Thinger state listener thrown warnings

Hi, I have coded the Thinger State listener like described at end of the coding guide:

But my compier throws a bench of warnings:

D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino: In lambda function:
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'NETWORK_CONNECTING' not handled in switch [-Wswitch]
  123 |     switch (thinger_state) {
      |            ^
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'NETWORK_CONNECTED' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'NETWORK_CONNECT_ERROR' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'SOCKET_CONNECTING' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'SOCKET_CONNECTED' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'SOCKET_CONNECTION_ERROR' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'SOCKET_DISCONNECTED' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'SOCKET_TIMEOUT' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'SOCKET_ERROR' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'THINGER_AUTHENTICATING' not handled in switch [-Wswitch]
D:\Activities\3_Maker\ESP_SwissArmyKnife_Rev10_2024\c_Setup.ino:123:12: warning: enumeration value 'THINGER_STOP_REQUEST' not handled in switch [-Wswitch]

My code is however directly derived from the coding guide:

  thing.set_state_listener([&](ThingerClient::THINGER_STATE state) {
    switch (state) {
      case ThingerClient::THINGER_AUTH_FAILED:
        Console1.print("\n***Thinger Auth Fail***");
        GracePause = 64;
        break;
      case ThingerClient::NETWORK_CONNECTING:
      case ThingerClient::NETWORK_CONNECT_ERROR:
      case ThingerClient::SOCKET_CONNECTING:
      case ThingerClient::SOCKET_CONNECTION_ERROR:
      case ThingerClient::SOCKET_DISCONNECTED:
      case ThingerClient::SOCKET_ERROR:
      case ThingerClient::SOCKET_TIMEOUT:
      case ThingerClient::THINGER_AUTHENTICATING:
      case ThingerClient::THINGER_STOP_REQUEST:
        Console1.print("\n***Network_Error***");
        GracePause = 64;
        break;
      case ThingerClient::THINGER_AUTHENTICATED:
        GracePause = 0;
        break;
      default:
        break;
    }
  });

Has someone got a clue why the states are not handled in the switch?

By the way, defining a variable “state” is not a good idea, it may conflict with other libraries.
Calling it “thinger_state” were more unique and les prone to conflicts.

Hi @rin67630

Sorry I tried compiling an example sketch in Arduino IDE for an ESP 32 DEV with the code you provided and haven’t received the warning you reported, even when the compiling output is configured to show full verbose and the compiler warnings are also configured to show all.

From the logs you attached it seems you are using a variable named thinger_state which is not the same as the code you provided. Is this code exactly the same as your sketch? If you don’t mind giving more details regarding your environment, board, and sketch we may be able to help you further.

Best regards

Hi,
Yes I have changed the name of the variable from “state” to “thinger_state” due to a conflict with another ESP 8266 library. But I get the same behaviour naming the variable “state” as well.
Meanwhile, I don’t care of the warnings, it seems to do the job like it should, maybe the Arduin IDE2 is just too touchy.

My bigger problem is now how to get Strings from device properties.