Adds even more code to HA_AUTODISCOVERY setting

Removes unused variable
This commit is contained in:
Paul Brand 2024-08-27 22:24:24 +02:00
parent feb726162f
commit ddb0623983

View file

@ -12,7 +12,6 @@
WiFiClient espClient; WiFiClient espClient;
PubSubClient client(espClient); PubSubClient client(espClient);
char mqtt_msg[MQTT_MSG_BUFFER_SIZE]; char mqtt_msg[MQTT_MSG_BUFFER_SIZE];
int value = 0;
static unsigned long previousMillisUpdateVal; static unsigned long previousMillisUpdateVal;
MyTimer publish_global_timer(5000); MyTimer publish_global_timer(5000);
@ -100,6 +99,7 @@ static void publish_cell_voltages(void) {
#endif // HA_AUTODISCOVERY #endif // HA_AUTODISCOVERY
} }
#ifdef HA_AUTODISCOVER
struct SensorConfig { struct SensorConfig {
const char* object_id; const char* object_id;
const char* name; const char* name;
@ -108,7 +108,6 @@ struct SensorConfig {
const char* device_class; const char* device_class;
}; };
#ifdef HA_AUTODISCOVERY
SensorConfig sensorConfigs[] = { SensorConfig sensorConfigs[] = {
{"SOC", "Battery Emulator SOC (scaled)", "{{ value_json.SOC }}", "%", "battery"}, {"SOC", "Battery Emulator SOC (scaled)", "{{ value_json.SOC }}", "%", "battery"},
{"SOC_real", "Battery Emulator SOC (real)", "{{ value_json.SOC_real }}", "%", "battery"}, {"SOC_real", "Battery Emulator SOC (real)", "{{ value_json.SOC_real }}", "%", "battery"},