1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-19 12:24:05 +00:00

update priority

This commit is contained in:
oarcher 2024-08-16 17:41:48 +02:00
parent d164ccd12a
commit 352111b556
5 changed files with 5 additions and 4 deletions

View File

@ -131,7 +131,7 @@ std::string get_signal_bars(float rssi, bool color) {
if (!color) { if (!color) {
if (std::isnan(rssi)) { if (std::isnan(rssi)) {
return {}; return "None";
} else if (rssi >= -50) { } else if (rssi >= -50) {
return "High"; return "High";
} else if (rssi >= -65) { } else if (rssi >= -65) {

View File

@ -141,7 +141,7 @@ void ModemSensor::update_gnss_sensors_() {
std::map<std::string, std::string> parts; std::map<std::string, std::string> parts;
auto at_command_result = global_modem_component->send_at("AT+CGNSSINFO"); auto at_command_result = global_modem_component->send_at("AT+CGNSSINFO");
if (at_command_result) { 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); parts = get_gnssinfo_tokens(gnss_info);
} }

View File

@ -28,7 +28,7 @@ class ModemSensor : public PollingComponent {
// ========== INTERNAL METHODS ========== // ========== INTERNAL METHODS ==========
// (In most use cases you won't need these) // (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 setup() override;
void update() override; void update() override;
void dump_config() override {} void dump_config() override {}

View File

@ -20,7 +20,7 @@ class GnssSwitch : public switch_::Switch, public Component {
// ========== INTERNAL METHODS ========== // ========== INTERNAL METHODS ==========
// (In most use cases you won't need these) // (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 dump_config() override;
void setup() override; void setup() override;
void loop() override; void loop() override;

View File

@ -26,6 +26,7 @@ CONFIG_SCHEMA = cv.All(
), ),
cv.Optional(CONF_SIGNAL_STRENGTH): text_sensor.text_sensor_schema( cv.Optional(CONF_SIGNAL_STRENGTH): text_sensor.text_sensor_schema(
device_class=DEVICE_CLASS_EMPTY, device_class=DEVICE_CLASS_EMPTY,
icon="mdi:signal",
), ),
} }
) )