From e6f21873c33703c8f82eddec080241c607c3f3c5 Mon Sep 17 00:00:00 2001 From: Andrzej Date: Sat, 8 Feb 2020 18:03:24 +0100 Subject: [PATCH] sim800l: Add support of roaming-registered SIM cards (#977) * Add support of roaming-registered cards * Change or to || --- esphome/components/sim800l/sim800l.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/sim800l/sim800l.cpp b/esphome/components/sim800l/sim800l.cpp index 1390ef8b49..9f8c733fa9 100644 --- a/esphome/components/sim800l/sim800l.cpp +++ b/esphome/components/sim800l/sim800l.cpp @@ -97,7 +97,7 @@ void Sim800LComponent::parse_cmd_(std::string message) { case STATE_CREGWAIT: { // Response: "+CREG: 0,1" -- the one there means registered ok // "+CREG: -,-" means not registered ok - bool registered = message.compare(0, 6, "+CREG:") == 0 && message[9] == '1'; + bool registered = message.compare(0, 6, "+CREG:") == 0 && (message[9] == '1' || message[9] == '5'); if (registered) { if (!this->registered_) ESP_LOGD(TAG, "Registered OK");