From 5e451fbf049152129d2af961577d2a483c55a3d5 Mon Sep 17 00:00:00 2001 From: Alex-K37 Date: Sat, 26 Nov 2022 22:07:29 +0100 Subject: [PATCH] fixed compilation error: ambiguous overload for 'operator=' .pio/libdeps/watchy/Watchy/src/Watchy.cpp: In member function 'weatherData Watchy::getWeatherData(String, String, String, String, String, uint8_t)': .pio/libdeps/watchy/Watchy/src/Watchy.cpp:620:48: error: ambiguous overload for 'operator=' (operand types are 'String' and 'JSONVar') responseObject["weather"][0]["main"]; ^ In file included from /home/krupp/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:166, from .pio/libdeps/watchy/Watchy/src/Watchy.h:4, from .pio/libdeps/watchy/Watchy/src/Watchy.cpp:1: /home/build/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:102:18: note: candidate: 'String& String::operator=(const String&)' String & operator =(const String &rhs); ^~~~~~~~ /home/build/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:103:18: note: candidate: 'String& String::operator=(const char*)' String & operator =(const char *cstr); ^~~~~~~~ --- src/Watchy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Watchy.cpp b/src/Watchy.cpp index fab4405..778b9e2 100644 --- a/src/Watchy.cpp +++ b/src/Watchy.cpp @@ -617,7 +617,7 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang, currentWeather.weatherConditionCode = int(responseObject["weather"][0]["id"]); currentWeather.weatherDescription = - responseObject["weather"][0]["main"]; + JSONVar::stringify(responseObject["weather"][0]["main"]); // sync NTP during weather API call and use timezone of city syncNTP(long(responseObject["timezone"])); } else {