From a159a9f899108f227c941d6620f4240035c13fc2 Mon Sep 17 00:00:00 2001 From: oarcher Date: Wed, 28 Aug 2024 21:05:53 +0200 Subject: [PATCH] is_connected from component state --- esphome/components/modem/modem_component.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/modem/modem_component.h b/esphome/components/modem/modem_component.h index 030b1fd041..1572b712c2 100644 --- a/esphome/components/modem/modem_component.h +++ b/esphome/components/modem/modem_component.h @@ -79,7 +79,7 @@ class ModemComponent : public Component { void enable_cmux() { this->cmux_ = true; } void enable_debug(); void add_init_at_command(const std::string &cmd) { this->init_at_commands_.push_back(cmd); } - bool is_connected() { return this->internal_state_.connected; } + bool is_connected() { return this->component_state_ == ModemComponentState::CONNECTED; } bool is_disabled() { return this->component_state_ == ModemComponentState::DISABLED; } bool is_modem_connected(bool verbose); // this if for modem only, not PPP bool is_modem_connected() { return this->is_modem_connected(true); }