mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-03 16:41:50 +00:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
			wifi_ssid_
			...
			jesserockz
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					46492fc875 | ||
| 
						 | 
					098a360f88 | ||
| 
						 | 
					5f43e5e5d8 | ||
| 
						 | 
					297dea4080 | ||
| 
						 | 
					03fd82b903 | ||
| 
						 | 
					65f741516b | ||
| 
						 | 
					3941f16465 | ||
| 
						 | 
					df60eef583 | ||
| 
						 | 
					ffbecd105c | 
							
								
								
									
										4
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -290,6 +290,10 @@ jobs:
 | 
				
			|||||||
            name: Run script/clang-tidy for ESP32 IDF
 | 
					            name: Run script/clang-tidy for ESP32 IDF
 | 
				
			||||||
            options: --environment esp32-idf-tidy --grep USE_ESP_IDF
 | 
					            options: --environment esp32-idf-tidy --grep USE_ESP_IDF
 | 
				
			||||||
            pio_cache_key: tidyesp32-idf
 | 
					            pio_cache_key: tidyesp32-idf
 | 
				
			||||||
 | 
					          - id: clang-tidy
 | 
				
			||||||
 | 
					            name: Run script/clang-tidy for LibreTiny
 | 
				
			||||||
 | 
					            options: --environment bk72xx-arduino --grep USE_LIBRETINY
 | 
				
			||||||
 | 
					            pio_cache_key: tidylibretiny
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Check out code from GitHub
 | 
					      - name: Check out code from GitHub
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,12 @@
 | 
				
			|||||||
#include "debug_component.h"
 | 
					#include "debug_component.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <algorithm>
 | 
					#include <algorithm>
 | 
				
			||||||
#include "esphome/core/log.h"
 | 
					 | 
				
			||||||
#include "esphome/core/hal.h"
 | 
					 | 
				
			||||||
#include "esphome/core/helpers.h"
 | 
					 | 
				
			||||||
#include "esphome/core/version.h"
 | 
					 | 
				
			||||||
#include <cinttypes>
 | 
					#include <cinttypes>
 | 
				
			||||||
#include <climits>
 | 
					#include <climits>
 | 
				
			||||||
 | 
					#include "esphome/core/hal.h"
 | 
				
			||||||
 | 
					#include "esphome/core/helpers.h"
 | 
				
			||||||
 | 
					#include "esphome/core/log.h"
 | 
				
			||||||
 | 
					#include "esphome/core/version.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace esphome {
 | 
					namespace esphome {
 | 
				
			||||||
namespace debug {
 | 
					namespace debug {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,9 +6,6 @@
 | 
				
			|||||||
#include "esphome/core/helpers.h"
 | 
					#include "esphome/core/helpers.h"
 | 
				
			||||||
#include "preferences.h"
 | 
					#include "preferences.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setup();
 | 
					 | 
				
			||||||
void loop();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace esphome {
 | 
					namespace esphome {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void IRAM_ATTR HOT yield() { ::yield(); }
 | 
					void IRAM_ATTR HOT yield() { ::yield(); }
 | 
				
			||||||
@@ -27,7 +24,7 @@ void arch_init() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void arch_restart() {
 | 
					void arch_restart() {
 | 
				
			||||||
  lt_reboot();
 | 
					  lt_reboot();
 | 
				
			||||||
  while (1) {
 | 
					  while (true) {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
void IRAM_ATTR HOT arch_feed_wdt() { lt_wdt_feed(); }
 | 
					void IRAM_ATTR HOT arch_feed_wdt() { lt_wdt_feed(); }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,12 +11,12 @@ static const char *const TAG = "lt.component";
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void LTComponent::dump_config() {
 | 
					void LTComponent::dump_config() {
 | 
				
			||||||
  ESP_LOGCONFIG(TAG, "LibreTiny:");
 | 
					  ESP_LOGCONFIG(TAG, "LibreTiny:");
 | 
				
			||||||
  ESP_LOGCONFIG(TAG, "  Version: %s", LT_BANNER_STR + 10);
 | 
					  ESP_LOGCONFIG(TAG, "  Version: %s", <_BANNER_STR[10]);
 | 
				
			||||||
  ESP_LOGCONFIG(TAG, "  Loglevel: %u", LT_LOGLEVEL);
 | 
					  ESP_LOGCONFIG(TAG, "  Loglevel: %u", LT_LOGLEVEL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef USE_TEXT_SENSOR
 | 
					#ifdef USE_TEXT_SENSOR
 | 
				
			||||||
  if (this->version_ != nullptr) {
 | 
					  if (this->version_ != nullptr) {
 | 
				
			||||||
    this->version_->publish_state(LT_BANNER_STR + 10);
 | 
					    this->version_->publish_state(<_BANNER_STR[10]);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif  // USE_TEXT_SENSOR
 | 
					#endif  // USE_TEXT_SENSOR
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,12 @@
 | 
				
			|||||||
#ifdef USE_LIBRETINY
 | 
					#ifdef USE_LIBRETINY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "esphome/core/preferences.h"
 | 
					#include "esphome/core/preferences.h"
 | 
				
			||||||
#include "esphome/core/helpers.h"
 | 
					 | 
				
			||||||
#include "esphome/core/log.h"
 | 
					 | 
				
			||||||
#include <flashdb.h>
 | 
					#include <flashdb.h>
 | 
				
			||||||
#include <cstring>
 | 
					#include <cstring>
 | 
				
			||||||
#include <vector>
 | 
					 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
 | 
					#include <vector>
 | 
				
			||||||
 | 
					#include "esphome/core/helpers.h"
 | 
				
			||||||
 | 
					#include "esphome/core/log.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace esphome {
 | 
					namespace esphome {
 | 
				
			||||||
namespace libretiny {
 | 
					namespace libretiny {
 | 
				
			||||||
@@ -74,7 +74,7 @@ class LibreTinyPreferences : public ESPPreferences {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  void open() {
 | 
					  void open() {
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    fdb_err_t err = fdb_kvdb_init(&db, "esphome", "kvs", NULL, NULL);
 | 
					    fdb_err_t err = fdb_kvdb_init(&db, "esphome", "kvs", nullptr, nullptr);
 | 
				
			||||||
    if (err != FDB_NO_ERR) {
 | 
					    if (err != FDB_NO_ERR) {
 | 
				
			||||||
      LT_E("fdb_kvdb_init(...) failed: %d", err);
 | 
					      LT_E("fdb_kvdb_init(...) failed: %d", err);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,10 @@
 | 
				
			|||||||
#ifdef USE_LIBRETINY
 | 
					#ifdef USE_LIBRETINY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "uart_component_libretiny.h"
 | 
				
			||||||
#include "esphome/core/application.h"
 | 
					#include "esphome/core/application.h"
 | 
				
			||||||
#include "esphome/core/defines.h"
 | 
					#include "esphome/core/defines.h"
 | 
				
			||||||
#include "esphome/core/helpers.h"
 | 
					#include "esphome/core/helpers.h"
 | 
				
			||||||
#include "esphome/core/log.h"
 | 
					#include "esphome/core/log.h"
 | 
				
			||||||
#include "uart_component_libretiny.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef USE_LOGGER
 | 
					#ifdef USE_LOGGER
 | 
				
			||||||
#include "esphome/components/logger/logger.h"
 | 
					#include "esphome/components/logger/logger.h"
 | 
				
			||||||
@@ -53,27 +53,25 @@ void LibreTinyUARTComponent::setup() {
 | 
				
			|||||||
  bool tx_inverted = tx_pin_ != nullptr && tx_pin_->is_inverted();
 | 
					  bool tx_inverted = tx_pin_ != nullptr && tx_pin_->is_inverted();
 | 
				
			||||||
  bool rx_inverted = rx_pin_ != nullptr && rx_pin_->is_inverted();
 | 
					  bool rx_inverted = rx_pin_ != nullptr && rx_pin_->is_inverted();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (false)
 | 
					 | 
				
			||||||
    return;
 | 
					 | 
				
			||||||
#if LT_HW_UART0
 | 
					#if LT_HW_UART0
 | 
				
			||||||
  else if ((tx_pin == -1 || tx_pin == PIN_SERIAL0_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL0_RX)) {
 | 
					  if ((tx_pin == -1 || tx_pin == PIN_SERIAL0_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL0_RX)) {
 | 
				
			||||||
    this->serial_ = &Serial0;
 | 
					    this->serial_ = &Serial0;
 | 
				
			||||||
    this->hardware_idx_ = 0;
 | 
					    this->hardware_idx_ = 0;
 | 
				
			||||||
  }
 | 
					  } else
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#if LT_HW_UART1
 | 
					#if LT_HW_UART1
 | 
				
			||||||
  else if ((tx_pin == -1 || tx_pin == PIN_SERIAL1_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL1_RX)) {
 | 
					      if ((tx_pin == -1 || tx_pin == PIN_SERIAL1_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL1_RX)) {
 | 
				
			||||||
    this->serial_ = &Serial1;
 | 
					    this->serial_ = &Serial1;
 | 
				
			||||||
    this->hardware_idx_ = 1;
 | 
					    this->hardware_idx_ = 1;
 | 
				
			||||||
  }
 | 
					  } else
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#if LT_HW_UART2
 | 
					#if LT_HW_UART2
 | 
				
			||||||
  else if ((tx_pin == -1 || tx_pin == PIN_SERIAL2_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL2_RX)) {
 | 
					      if ((tx_pin == -1 || tx_pin == PIN_SERIAL2_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL2_RX)) {
 | 
				
			||||||
    this->serial_ = &Serial2;
 | 
					    this->serial_ = &Serial2;
 | 
				
			||||||
    this->hardware_idx_ = 2;
 | 
					    this->hardware_idx_ = 2;
 | 
				
			||||||
  }
 | 
					  } else
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
  else {
 | 
					  {
 | 
				
			||||||
#if LT_ARD_HAS_SOFTSERIAL
 | 
					#if LT_ARD_HAS_SOFTSERIAL
 | 
				
			||||||
    this->serial_ = new SoftwareSerial(rx_pin, tx_pin, rx_inverted || tx_inverted);
 | 
					    this->serial_ = new SoftwareSerial(rx_pin, tx_pin, rx_inverted || tx_inverted);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,16 +3,16 @@
 | 
				
			|||||||
#ifdef USE_WIFI
 | 
					#ifdef USE_WIFI
 | 
				
			||||||
#ifdef USE_LIBRETINY
 | 
					#ifdef USE_LIBRETINY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <utility>
 | 
					 | 
				
			||||||
#include <algorithm>
 | 
					#include <algorithm>
 | 
				
			||||||
#include "lwip/ip_addr.h"
 | 
					#include <utility>
 | 
				
			||||||
#include "lwip/err.h"
 | 
					 | 
				
			||||||
#include "lwip/dns.h"
 | 
					#include "lwip/dns.h"
 | 
				
			||||||
 | 
					#include "lwip/err.h"
 | 
				
			||||||
 | 
					#include "lwip/ip_addr.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "esphome/core/application.h"
 | 
				
			||||||
 | 
					#include "esphome/core/hal.h"
 | 
				
			||||||
#include "esphome/core/helpers.h"
 | 
					#include "esphome/core/helpers.h"
 | 
				
			||||||
#include "esphome/core/log.h"
 | 
					#include "esphome/core/log.h"
 | 
				
			||||||
#include "esphome/core/hal.h"
 | 
					 | 
				
			||||||
#include "esphome/core/application.h"
 | 
					 | 
				
			||||||
#include "esphome/core/util.h"
 | 
					#include "esphome/core/util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace esphome {
 | 
					namespace esphome {
 | 
				
			||||||
@@ -120,9 +120,9 @@ bool WiFiComponent::wifi_sta_connect_(const WiFiAP &ap) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  s_sta_connecting = true;
 | 
					  s_sta_connecting = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  WiFiStatus status = WiFi.begin(ap.get_ssid().c_str(), ap.get_password().empty() ? NULL : ap.get_password().c_str(),
 | 
					  WiFiStatus status = WiFi.begin(ap.get_ssid().c_str(), ap.get_password().empty() ? nullptr : ap.get_password().c_str(),
 | 
				
			||||||
                                 ap.get_channel().has_value() ? *ap.get_channel() : 0,
 | 
					                                 ap.get_channel().has_value() ? *ap.get_channel() : 0,
 | 
				
			||||||
                                 ap.get_bssid().has_value() ? ap.get_bssid()->data() : NULL);
 | 
					                                 ap.get_bssid().has_value() ? ap.get_bssid()->data() : nullptr);
 | 
				
			||||||
  if (status != WL_CONNECTED) {
 | 
					  if (status != WL_CONNECTED) {
 | 
				
			||||||
    ESP_LOGW(TAG, "esp_wifi_connect failed! %d", status);
 | 
					    ESP_LOGW(TAG, "esp_wifi_connect failed! %d", status);
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
@@ -453,7 +453,7 @@ bool WiFiComponent::wifi_start_ap_(const WiFiAP &ap) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  yield();
 | 
					  yield();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return WiFi.softAP(ap.get_ssid().c_str(), ap.get_password().empty() ? NULL : ap.get_password().c_str(),
 | 
					  return WiFi.softAP(ap.get_ssid().c_str(), ap.get_password().empty() ? nullptr : ap.get_password().c_str(),
 | 
				
			||||||
                     ap.get_channel().value_or(1), ap.get_hidden());
 | 
					                     ap.get_channel().value_or(1), ap.get_hidden());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user