mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 10:49:42 +02:00
Adds even more code to HA_AUTODISCOVERY setting
Removes unused variable
This commit is contained in:
parent
feb726162f
commit
ddb0623983
1 changed files with 1 additions and 2 deletions
|
@ -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"},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue