Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom ESPHome firmware and Tuya integration
#13
(08-06-2024, 09:00 AM)admin Wrote: how you done all step, post all screen photos.

All steps:
In ESPHome I create a new device, add your exemple code modifying with my personal informations and at the moment of compiling I have the error I showed you that points to an error in the format of the data sent to
Quote:json::parse_json
so seems directly linked to what 
Quote:esphome::tuya_iot::TuyaIotComponent:Confusedubscribe_json
 is returning.

The error:
Quote:error: invalid initialization of reference of type 'const json_parse_t&' {aka 'const std::function<bool(ArduinoJson6185_D1::ObjectRef)>&'} from expression of type 'esphome::tuya_iot::TuyaIotComponent:Confusedubscribe_json(const string&, const mqtt_json_callback_t&, uint8_t)::<lambda(const string&, const string&)>::<lambda(ArduinoJson::JsonObject)>'

The complete error:
Code:
src/esphome/components/tuya_iot/tuya_iot_component.cpp: In lambda function:
src/esphome/components/tuya_iot/tuya_iot_component.cpp:167:96: error: invalid initialization of reference of type 'const json_parse_t&' {aka 'const std::function<bool(ArduinoJson6185_D1::ObjectRef)>&'} from expression of type 'esphome::tuya_iot::TuyaIotComponent::subscribe_json(const string&, const mqtt_json_callback_t&, uint8_t)::<lambda(const string&, const string&)>::<lambda(ArduinoJson::JsonObject)>'
         json::parse_json(payload, [topic, callback](JsonObject root) { callback(topic, root); });
                                                                                                ^
In file included from src/esphome.h:21,
                 from src/esphome/components/tuya_iot/tuya_iot_component.h:3,
                 from src/esphome/components/tuya_iot/tuya_iot_component.cpp:1:
src/esphome/components/json/json_util.h:26:6: note: in passing argument 2 of 'bool esphome::json::parse_json(const string&, const json_parse_t&)'
bool parse_json(const std::string &data, const json_parse_t &f);
      ^~~~~~~~~~
Compiling .pioenvs/tuya-test/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
*** [.pioenvs/tuya-test/src/esphome/components/tuya_iot/tuya_iot_component.cpp.o] Error 1
========================= [FAILED] Took 55.72 seconds =========================

Tried with the librairies in local, external, everything, I think.
Reply


Messages In This Thread
RE: Custom ESPHome firmware and Tuya integration - by Stouf - 08-07-2024, 01:01 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)