When using just the VEML6075 custom code on its own, compiling the code fails with the following error:
In file included from src/esphome/components/sensor/sensor.h:3:0,
from src/esphome/core/application.h:15,
from src/esphome/components/api/api_connection.h:4,
from src/esphome.h:2,
from src/main.cpp:3:
src/veml6075_sensor.h: In member function 'virtual void VEML6075Sensor::setup()':
src/esphome/components/sensor/sensor.h:14:19: error: 'TAG' was not declared in this scope
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
^
src/esphome/core/log.h:97:45: note: in definition of macro 'esph_log_config'
esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
^
src/esphome/components/sensor/sensor.h:14:5: note: in expansion of macro 'ESP_LOGCONFIG'
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
^
src/veml6075_sensor.h:21:7: note: in expansion of macro 'LOG_SENSOR'
LOG_SENSOR(" ", "UVA", this->uva_sensor);
^
src/esphome/components/sensor/sensor.h:14:19: error: 'TAG' was not declared in this scope
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
^
src/esphome/core/log.h:97:45: note: in definition of macro 'esph_log_config'
esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
^
src/esphome/components/sensor/sensor.h:14:5: note: in expansion of macro 'ESP_LOGCONFIG'
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
^
src/veml6075_sensor.h:22:7: note: in expansion of macro 'LOG_SENSOR'
LOG_SENSOR(" ", "UVB", this->uvb_sensor);
^
src/esphome/components/sensor/sensor.h:14:19: error: 'TAG' was not declared in this scope
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
^
src/esphome/core/log.h:97:45: note: in definition of macro 'esph_log_config'
esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
^
src/esphome/components/sensor/sensor.h:14:5: note: in expansion of macro 'ESP_LOGCONFIG'
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \
^
src/veml6075_sensor.h:23:7: note: in expansion of macro 'LOG_SENSOR'
LOG_SENSOR(" ", "UVI", this->uvi_sensor);
^
Compiling .pioenvs/esp_weather_station/lib0eb/WiFi/WiFiSTA.cpp.o
*** [.pioenvs/esp_weather_station/src/main.cpp.o] Error 1