diff --git a/esphome/components/modem/modem_component.cpp b/esphome/components/modem/modem_component.cpp index fcd10e7c71..d6eb35ba3a 100644 --- a/esphome/components/modem/modem_component.cpp +++ b/esphome/components/modem/modem_component.cpp @@ -51,6 +51,8 @@ ModemComponent::ModemComponent() { global_modem_component = this; } +void ModemComponent::enable_debug() { esp_log_level_set("command_lib", ESP_LOG_VERBOSE); } + std::string ModemComponent::send_at(const std::string &cmd) { std::string result = "ERROR"; command_result status = command_result::FAIL; diff --git a/esphome/components/modem/modem_component.h b/esphome/components/modem/modem_component.h index 380c8153a6..ee13f0021a 100644 --- a/esphome/components/modem/modem_component.h +++ b/esphome/components/modem/modem_component.h @@ -61,7 +61,7 @@ class ModemComponent : public Component { void set_gnss_power_command(const std::string &at_command) { this->gnss_power_command_ = at_command; } void set_not_responding_cb(Trigger<> *not_responding_cb) { this->not_responding_cb_ = not_responding_cb; } void enable_cmux() { this->cmux_ = true; } - void enable_debug() { esp_log_level_set("command_lib", ESP_LOG_VERBOSE); } + void enable_debug(); void add_init_at_command(const std::string &cmd) { this->init_at_commands_.push_back(cmd); } bool is_connected() { return this->component_state_ == ModemComponentState::CONNECTED; } bool is_disabled() { return this->component_state_ == ModemComponentState::DISABLED; } diff --git a/esphome/components/modem/sensor/__init__.py b/esphome/components/modem/sensor/__init__.py index 312bd32811..c47f2db8c0 100644 --- a/esphome/components/modem/sensor/__init__.py +++ b/esphome/components/modem/sensor/__init__.py @@ -1,10 +1,5 @@ import esphome.codegen as cg from esphome.components import sensor -from esphome.components.modem import ( - CONF_ENABLE_GNSS, - CONF_MODEM, - final_validate_platform, -) import esphome.config_validation as cv from esphome.const import ( CONF_ALTITUDE, @@ -20,6 +15,8 @@ from esphome.const import ( ) import esphome.final_validate as fv +from .. import CONF_ENABLE_GNSS, CONF_MODEM, final_validate_platform + CODEOWNERS = ["@oarcher"] AUTO_LOAD = [] diff --git a/esphome/components/modem/sensor/modem_sensor.cpp b/esphome/components/modem/sensor/modem_sensor.cpp index d87dfd04b6..0a02a191f4 100644 --- a/esphome/components/modem/sensor/modem_sensor.cpp +++ b/esphome/components/modem/sensor/modem_sensor.cpp @@ -10,7 +10,7 @@ #include "esphome/core/log.h" #include "esphome/core/application.h" -#include "esphome/components/modem/modem_component.h" +#include "../modem_component.h" #include #include diff --git a/esphome/components/modem/text_sensor/__init__.py b/esphome/components/modem/text_sensor/__init__.py index 7922bfca6d..e9bf8db953 100644 --- a/esphome/components/modem/text_sensor/__init__.py +++ b/esphome/components/modem/text_sensor/__init__.py @@ -1,9 +1,10 @@ import esphome.codegen as cg from esphome.components import text_sensor -from esphome.components.modem import final_validate_platform import esphome.config_validation as cv from esphome.const import CONF_ID, DEVICE_CLASS_EMPTY +from .. import final_validate_platform + CODEOWNERS = ["@oarcher"] AUTO_LOAD = [] diff --git a/esphome/components/modem/text_sensor/modem_text_sensor.cpp b/esphome/components/modem/text_sensor/modem_text_sensor.cpp index d1cf2088bc..5db9887a51 100644 --- a/esphome/components/modem/text_sensor/modem_text_sensor.cpp +++ b/esphome/components/modem/text_sensor/modem_text_sensor.cpp @@ -10,8 +10,7 @@ #include "esphome/core/log.h" #include "esphome/core/application.h" -// #include "esphome/components/watchdog/watchdog.h" -#include "esphome/components/modem/modem_component.h" +#include "../modem_component.h" #define ESPHL_ERROR_CHECK(err, message) \ if ((err) != ESP_OK) { \