This commit is contained in:
MichaelDvP
2023-09-09 16:46:53 +02:00
8 changed files with 122 additions and 62 deletions

View File

@@ -922,9 +922,9 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
if (EMSESP::system_.enum_format() == ENUM_FORMAT_INDEX) {
// use index numbers
for (uint8_t i = 0; i < options_size; i++) {
option_list.add(i);
option_list.add(Helpers::itoa(i)); // as a string
}
snprintf(sample_val, sizeof(sample_val), "0");
snprintf(sample_val, sizeof(sample_val), "'0'");
} else {
// use strings
for (uint8_t i = 0; i < options_size; i++) {

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.6.1-dev.2"
#define EMSESP_APP_VERSION "3.7.0-dev.0"

View File

@@ -220,6 +220,12 @@ void WebSchedulerService::publish_single(const char * name, const bool state) {
// publish to Mqtt
void WebSchedulerService::publish(const bool force) {
if (force) {
ha_registered_ = false;
}
if (!Mqtt::enabled()) {
return;
}
EMSESP::webSchedulerService.read([&](WebScheduler & webScheduler) { scheduleItems = &webScheduler.scheduleItems; });
if (scheduleItems->size() == 0) {
return;