diff --git a/esphome/components/modem/modem_component.cpp b/esphome/components/modem/modem_component.cpp index 2b75194fd6..c99e83d1f8 100644 --- a/esphome/components/modem/modem_component.cpp +++ b/esphome/components/modem/modem_component.cpp @@ -124,6 +124,7 @@ void ModemComponent::setup() { ESP_LOGV(TAG, "DCE setup"); + // clang-format off ( create_modem_dce(dce_factory::ModemType, config, std::move(dte), netif) is private ) switch (this->model_) { case ModemModel::BG96: this->dce = create_BG96_dce(&dce_config, this->dte_, this->ppp_netif_); @@ -138,10 +139,11 @@ void ModemComponent::setup() { this->dce = create_SIM7600_dce(&dce_config, this->dte_, this->ppp_netif_); break; default: - ESP_LOGE(TAG, "Unknown model"); + ESP_LOGE(TAG, "Unknown modem model"); return; break; } + // clang-format on assert(this->dce); diff --git a/esphome/components/modem/modem_component.h b/esphome/components/modem/modem_component.h index 848c966692..ffe87b7a64 100644 --- a/esphome/components/modem/modem_component.h +++ b/esphome/components/modem/modem_component.h @@ -11,7 +11,13 @@ // esp_modem will use esphome logger (needed if other components include esphome/core/log.h) // We need to do this because "cxx_include/esp_modem_api.hpp" is not a pure C++ header, and use logging. +// FIXME: Find another workaround. clang is currently disabled. +// error: using declarations in the global namespace in headers are prohibited +// [google-global-names-in-headers,-warnings-as-errors] +// clang-format off using esphome::esp_log_printf_; +// clang-format on + #include #include #include @@ -31,7 +37,7 @@ enum class ModemComponentState { CONNECTED, }; -enum class ModemModel { BG96, SIM800, SIM7000, SIM7070, SIM7070_GNSS, SIM7600, UNKNOWN }; +enum class ModemModel { BG96, SIM800, SIM7000, SIM7070, SIM7600, UNKNOWN }; class ModemComponent : public Component { public: @@ -73,7 +79,6 @@ class ModemComponent : public Component { {"SIM800", ModemModel::SIM800}, {"SIM7000", ModemModel::SIM7000}, {"SIM7070", ModemModel::SIM7070}, - {"SIM7070_GNSS", ModemModel::SIM7070_GNSS}, {"SIM7600", ModemModel::SIM7600}}; std::shared_ptr dte_; esp_netif_t *ppp_netif_{nullptr};