From 352111b556e3e8edd192cf97e107d59d111942f2 Mon Sep 17 00:00:00 2001 From: oarcher Date: Fri, 16 Aug 2024 17:41:48 +0200 Subject: [PATCH] update priority --- esphome/components/modem/helpers.cpp | 2 +- esphome/components/modem/sensor/modem_sensor.cpp | 2 +- esphome/components/modem/sensor/modem_sensor.h | 2 +- esphome/components/modem/switch/gnns_switch.h | 2 +- esphome/components/modem/text_sensor/__init__.py | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/esphome/components/modem/helpers.cpp b/esphome/components/modem/helpers.cpp index 07ae746271..73b387918a 100644 --- a/esphome/components/modem/helpers.cpp +++ b/esphome/components/modem/helpers.cpp @@ -131,7 +131,7 @@ std::string get_signal_bars(float rssi, bool color) { if (!color) { if (std::isnan(rssi)) { - return {}; + return "None"; } else if (rssi >= -50) { return "High"; } else if (rssi >= -65) { diff --git a/esphome/components/modem/sensor/modem_sensor.cpp b/esphome/components/modem/sensor/modem_sensor.cpp index b5c4a3c6b6..14d9b190a5 100644 --- a/esphome/components/modem/sensor/modem_sensor.cpp +++ b/esphome/components/modem/sensor/modem_sensor.cpp @@ -141,7 +141,7 @@ void ModemSensor::update_gnss_sensors_() { std::map parts; auto at_command_result = global_modem_component->send_at("AT+CGNSSINFO"); if (at_command_result) { - std::string gnss_info = at_command_result.result; + std::string gnss_info = at_command_result.output; parts = get_gnssinfo_tokens(gnss_info); } diff --git a/esphome/components/modem/sensor/modem_sensor.h b/esphome/components/modem/sensor/modem_sensor.h index 5f41593768..c5a40dd1d4 100644 --- a/esphome/components/modem/sensor/modem_sensor.h +++ b/esphome/components/modem/sensor/modem_sensor.h @@ -28,7 +28,7 @@ class ModemSensor : public PollingComponent { // ========== INTERNAL METHODS ========== // (In most use cases you won't need these) - float get_setup_priority() const override { return setup_priority::AFTER_WIFI; } + float get_setup_priority() const override { return setup_priority::AFTER_CONNECTION; } void setup() override; void update() override; void dump_config() override {} diff --git a/esphome/components/modem/switch/gnns_switch.h b/esphome/components/modem/switch/gnns_switch.h index a80c42f486..4e42df240f 100644 --- a/esphome/components/modem/switch/gnns_switch.h +++ b/esphome/components/modem/switch/gnns_switch.h @@ -20,7 +20,7 @@ class GnssSwitch : public switch_::Switch, public Component { // ========== INTERNAL METHODS ========== // (In most use cases you won't need these) - float get_setup_priority() const override { return setup_priority::AFTER_WIFI; } + float get_setup_priority() const override { return setup_priority::AFTER_CONNECTION; } void dump_config() override; void setup() override; void loop() override; diff --git a/esphome/components/modem/text_sensor/__init__.py b/esphome/components/modem/text_sensor/__init__.py index 560796a21e..7136f42367 100644 --- a/esphome/components/modem/text_sensor/__init__.py +++ b/esphome/components/modem/text_sensor/__init__.py @@ -26,6 +26,7 @@ CONFIG_SCHEMA = cv.All( ), cv.Optional(CONF_SIGNAL_STRENGTH): text_sensor.text_sensor_schema( device_class=DEVICE_CLASS_EMPTY, + icon="mdi:signal", ), } )