homieiot / homie-esp8266

💡 ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
http://homieiot.github.io/homie-esp8266
MIT License
1.36k stars 307 forks source link

#develop shall support latest ArduinoJson 6.17 #690

Open euphi opened 4 years ago

euphi commented 4 years ago

See also #689

homie-esp8266 source seems incompatible to the latest stable ArduinoJson release 6.17.0. As a workaround the library.json file was changed to stick to older minor version. As a clean solution, the homie-esp8266 source needs to be adapted to latest ArduiniJson.

Error message:

.pio/libdeps/esp01/Homie/src/Homie/Config.cpp: In member function 'bool HomieInternals::Config::load()':
.pio/libdeps/esp01/Homie/src/Homie/Config.cpp:74:53: error: ambiguous overload for 'operator|' (operand types are 'ArduinoJson6170_91::enable_if<true, ArduinoJson6170_91::MemberProxy<ArduinoJson6170_91::ObjectRef, const char*> >::type {aka ArduinoJson6170_91::MemberProxy<ArduinoJson6170_91::ObjectRef, const char*>}' and 'const char*')
   const char* reqDeviceId = parsedJson["device_id"] | DeviceId::get();
                                                     ^
.pio/libdeps/esp01/Homie/src/Homie/Config.cpp:74:53: note: candidates are:
In file included from .pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantRef.hpp:16:0,
                 from .pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Array/ArrayIterator.hpp:8,
                 from .pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp:8,
                 from .pio/libdeps/esp01/ArduinoJson/src/ArduinoJson.hpp:17,
                 from .pio/libdeps/esp01/ArduinoJson/src/ArduinoJson.h:9,
                 from .pio/libdeps/esp01/Homie/src/Homie/Config.hpp:5,
                 from .pio/libdeps/esp01/Homie/src/Homie/Config.cpp:1:
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:33:71: note: typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type ArduinoJson6170_91::operator|(const TVariant&, T) [with T = const char*; TVariant = ArduinoJson6170_91::MemberProxy<ArduinoJson6170_91::ObjectRef, const char*>; typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type = const char*]
   friend typename enable_if<is_same<T, const char *>::value, T>::type operator|(
                                                                       ^
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:22:62: note: typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type ArduinoJson6170_91::operator|(const TVariant&, const T&) [with T = const char*; TVariant = ArduinoJson6170_91::MemberProxy<ArduinoJson6170_91::ObjectRef, const char*>; typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type = const char*]
   friend typename enable_if<!IsVisitable<T>::value, T>::type operator|(
                                                              ^
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:33:71: note: typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type ArduinoJson6170_91::operator|(const TVariant&, T) [with T = const char*; TVariant = ArduinoJson6170_91::ElementProxy<ArduinoJson6170_91::JsonDocument&>; typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type = const char*]
   friend typename enable_if<is_same<T, const char *>::value, T>::type operator|(
                                                                       ^
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:22:62: note: typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type ArduinoJson6170_91::operator|(const TVariant&, const T&) [with T = const char*; TVariant = ArduinoJson6170_91::ElementProxy<ArduinoJson6170_91::JsonDocument&>; typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type = const char*]
   friend typename enable_if<!IsVisitable<T>::value, T>::type operator|(
                                                              ^
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:33:71: note: typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type ArduinoJson6170_91::operator|(const TVariant&, T) [with T = const char*; TVariant = ArduinoJson6170_91::VariantConstRef; typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type = const char*]
   friend typename enable_if<is_same<T, const char *>::value, T>::type operator|(
                                                                       ^
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:22:62: note: typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type ArduinoJson6170_91::operator|(const TVariant&, const T&) [with T = const char*; TVariant = ArduinoJson6170_91::VariantConstRef; typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type = const char*]
   friend typename enable_if<!IsVisitable<T>::value, T>::type operator|(
                                                              ^
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:33:71: note: typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type ArduinoJson6170_91::operator|(const TVariant&, T) [with T = const char*; TVariant = ArduinoJson6170_91::VariantRef; typename ArduinoJson6170_91::enable_if<ArduinoJson6170_91::is_same<T, const char*>::value, T>::type = const char*]
   friend typename enable_if<is_same<T, const char *>::value, T>::type operator|(
                                                                       ^
.pio/libdeps/esp01/ArduinoJson/src/ArduinoJson/Variant/VariantOperators.hpp:22:62: note: typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type ArduinoJson6170_91::operator|(const TVariant&, const T&) [with T = const char*; TVariant = ArduinoJson6170_91::VariantRef; typename ArduinoJson6170_91::enable_if<(! ArduinoJson6170_91::IsVisitable<T>::value), T>::type = const char*]
   friend typename enable_if<!IsVisitable<T>::value, T>::type operator|(
                                                              ^
.pio/libdeps/esp01/Homie/src/Homie/Config.cpp:88:8: warning: unused variable 'reqMqttSsl' [-Wunused-variable]
   bool reqMqttSsl = reqMqtt["ssl"] | false;
        ^
.pio/libdeps/esp01/Homie/src/Homie/Config.cpp:92:15: warning: unused variable 'reqMqttFingerprint' [-Wunused-variable]
   const char* reqMqttFingerprint = reqMqtt["ssl_fingerprint"] | "";
               ^
mkfrey commented 4 years ago

This has been fixed with ArduinoJson v6.17.1, see https://github.com/bblanchon/ArduinoJson/releases/tag/v6.17.1.