HASwitchPlate / openHASP

HomeAutomation Switchplate based on lvgl for ESP32
https://www.openhasp.com
MIT License
726 stars 185 forks source link

undefined reference to `mqttNodeTopic' #726

Closed Martinson50 closed 5 months ago

Martinson50 commented 6 months ago

undefined reference to `mqttNodeTopic' when #define HASP_USE_HA

Just uncomment and compile then... /home/bambu/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/lolin-d32-pro_ili9341/src/mqtt/hasp_mqtt_ha.cpp.o:(.literal._Z22mqtt_ha_add_device_idsRN11ArduinoJson8V6215PD212JsonDocumentE+0x24): undefined reference to `mqttNodeTopic'

Martinson50 commented 6 months ago

Dirty patch in line 88 void mqtt_ha_add_device_ids(JsonDocument& doc) { JsonObject device = doc.createNestedObject(FPSTR(FP_MQTT_HA_DEVICE)); JsonArray ids = device.createNestedArray(FPSTR(FP_MQTT_HA_IDENTIFIERS)); ids.add(haspDevice.get_hostname()); ids.add(haspDevice.get_hardware_id());

device[F("sw")]                        = haspDevice.get_version();
device[FPSTR(FP_MQTT_HA_NAME)]         = haspDevice.get_hostname();
device[FPSTR(FP_MQTT_HA_MODEL)]        = F(PIOENV);
device[FPSTR(FP_MQTT_HA_MANUFACTURER)] = F(D_MANUFACTURER);

doc[F("~")] = "hasp/plate/"; <---- doc[F("~")] = mqttNodeTopic; ORIGINAL

}

fvanroie commented 6 months ago

HASP_USE_HA is no longer supported.

corbolais commented 2 months ago

include/user_config_override-template.h still references this #define HASP_USE_HA:

grep -nH HASP_USE_HA include/user_config_override-template.h
include/user_config_override-template.h:151://#define HASP_USE_HA                                // Enable Home Assistant auto-discovery