Merge pull request #399 from bobbycar-graz/fix-open-quickaction

Skip empty configs on door open quickaction
This commit is contained in:
Michael Ehrenreich
2023-04-04 08:32:50 +02:00
committed by GitHub

View File

@@ -95,6 +95,9 @@ void open_garage()
return; return;
for (const auto &config : configs.wireless_door_configs) for (const auto &config : configs.wireless_door_configs)
{ {
if (config.doorId.value().empty() || config.doorToken.value().empty())
continue;
if (const auto error = espnow::send_espnow_message(fmt::format("BOBBYOPEN:{}:{}", config.doorId.value(), config.doorToken.value())); error != ESP_OK) if (const auto error = espnow::send_espnow_message(fmt::format("BOBBYOPEN:{}:{}", config.doorId.value(), config.doorToken.value())); error != ESP_OK)
{ {
ESP_LOGE("BOBBY", "send_espnow_message() failed with: %s", esp_err_to_name(error)); ESP_LOGE("BOBBY", "send_espnow_message() failed with: %s", esp_err_to_name(error));