mirror of
https://github.com/esphome/esphome.git
synced 2025-11-02 08:01:50 +00:00
Compare commits
13 Commits
2022.12.0b
...
2022.12.0b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f408f1a368 | ||
|
|
7d8d563c62 | ||
|
|
0a1f705fda | ||
|
|
1952c1880b | ||
|
|
b03967dac1 | ||
|
|
bcae2596a6 | ||
|
|
fc0347c86c | ||
|
|
d9563d4de1 | ||
|
|
cc7e2bf8db | ||
|
|
5d98e2923b | ||
|
|
07197d12f6 | ||
|
|
7b0a298497 | ||
|
|
21679cf2ba |
@@ -2,11 +2,13 @@ from esphome.components import esp32_ble_tracker, esp32_ble_client
|
||||
import esphome.config_validation as cv
|
||||
import esphome.codegen as cg
|
||||
from esphome.const import CONF_ACTIVE, CONF_ID
|
||||
from esphome.components.esp32 import add_idf_sdkconfig_option
|
||||
|
||||
AUTO_LOAD = ["esp32_ble_client", "esp32_ble_tracker"]
|
||||
DEPENDENCIES = ["api", "esp32"]
|
||||
CODEOWNERS = ["@jesserockz"]
|
||||
|
||||
CONF_CACHE_SERVICES = "cache_services"
|
||||
CONF_CONNECTIONS = "connections"
|
||||
MAX_CONNECTIONS = 3
|
||||
|
||||
@@ -47,6 +49,9 @@ CONFIG_SCHEMA = cv.All(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(BluetoothProxy),
|
||||
cv.Optional(CONF_ACTIVE, default=False): cv.boolean,
|
||||
cv.SplitDefault(CONF_CACHE_SERVICES, esp32_idf=True): cv.All(
|
||||
cv.only_with_esp_idf, cv.boolean
|
||||
),
|
||||
cv.Optional(CONF_CONNECTIONS): cv.All(
|
||||
cv.ensure_list(CONNECTION_SCHEMA),
|
||||
cv.Length(min=1, max=MAX_CONNECTIONS),
|
||||
@@ -72,4 +77,7 @@ async def to_code(config):
|
||||
cg.add(var.register_connection(connection_var))
|
||||
await esp32_ble_tracker.register_client(connection_var, connection_conf)
|
||||
|
||||
if config.get(CONF_CACHE_SERVICES):
|
||||
add_idf_sdkconfig_option("CONFIG_BT_GATTC_CACHE_NVS_FLASH", True)
|
||||
|
||||
cg.add_define("USE_BLUETOOTH_PROXY")
|
||||
|
||||
@@ -27,10 +27,10 @@ DEFAULT_DELAY = "2ms"
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(CD74HC4067Component),
|
||||
cv.Required(CONF_PIN_S0): pins.internal_gpio_output_pin_schema,
|
||||
cv.Required(CONF_PIN_S1): pins.internal_gpio_output_pin_schema,
|
||||
cv.Required(CONF_PIN_S2): pins.internal_gpio_output_pin_schema,
|
||||
cv.Required(CONF_PIN_S3): pins.internal_gpio_output_pin_schema,
|
||||
cv.Required(CONF_PIN_S0): pins.gpio_output_pin_schema,
|
||||
cv.Required(CONF_PIN_S1): pins.gpio_output_pin_schema,
|
||||
cv.Required(CONF_PIN_S2): pins.gpio_output_pin_schema,
|
||||
cv.Required(CONF_PIN_S3): pins.gpio_output_pin_schema,
|
||||
cv.Optional(
|
||||
CONF_DELAY, default=DEFAULT_DELAY
|
||||
): cv.positive_time_period_milliseconds,
|
||||
|
||||
@@ -19,22 +19,22 @@ class CD74HC4067Component : public Component {
|
||||
void activate_pin(uint8_t pin);
|
||||
|
||||
/// set the pin connected to multiplexer control pin 0
|
||||
void set_pin_s0(InternalGPIOPin *pin) { this->pin_s0_ = pin; }
|
||||
void set_pin_s0(GPIOPin *pin) { this->pin_s0_ = pin; }
|
||||
/// set the pin connected to multiplexer control pin 1
|
||||
void set_pin_s1(InternalGPIOPin *pin) { this->pin_s1_ = pin; }
|
||||
void set_pin_s1(GPIOPin *pin) { this->pin_s1_ = pin; }
|
||||
/// set the pin connected to multiplexer control pin 2
|
||||
void set_pin_s2(InternalGPIOPin *pin) { this->pin_s2_ = pin; }
|
||||
void set_pin_s2(GPIOPin *pin) { this->pin_s2_ = pin; }
|
||||
/// set the pin connected to multiplexer control pin 3
|
||||
void set_pin_s3(InternalGPIOPin *pin) { this->pin_s3_ = pin; }
|
||||
void set_pin_s3(GPIOPin *pin) { this->pin_s3_ = pin; }
|
||||
|
||||
/// set the delay needed after an input switch
|
||||
void set_switch_delay(uint32_t switch_delay) { this->switch_delay_ = switch_delay; }
|
||||
|
||||
private:
|
||||
InternalGPIOPin *pin_s0_;
|
||||
InternalGPIOPin *pin_s1_;
|
||||
InternalGPIOPin *pin_s2_;
|
||||
InternalGPIOPin *pin_s3_;
|
||||
GPIOPin *pin_s0_;
|
||||
GPIOPin *pin_s1_;
|
||||
GPIOPin *pin_s2_;
|
||||
GPIOPin *pin_s3_;
|
||||
/// the currently active pin
|
||||
uint8_t active_pin_;
|
||||
uint32_t switch_delay_;
|
||||
|
||||
@@ -398,11 +398,11 @@ spiffs, data, spiffs, 0x391000, 0x00F000
|
||||
|
||||
IDF_PARTITIONS_CSV = """\
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, , 0x4000,
|
||||
otadata, data, ota, , 0x2000,
|
||||
phy_init, data, phy, , 0x1000,
|
||||
app0, app, ota_0, , 0x1C0000,
|
||||
app1, app, ota_1, , 0x1C0000,
|
||||
nvs, data, nvs, , 0x6d000,
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -95,7 +95,9 @@ void BLEClientBase::release_services() {
|
||||
for (auto &svc : this->services_)
|
||||
delete svc; // NOLINT(cppcoreguidelines-owning-memory)
|
||||
this->services_.clear();
|
||||
#ifndef CONFIG_BT_GATTC_CACHE_NVS_FLASH
|
||||
esp_ble_gattc_cache_clean(this->remote_bda_);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t esp_gattc_if,
|
||||
|
||||
@@ -705,8 +705,13 @@ void ESPBTDevice::parse_adv_(const esp_ble_gap_cb_param_t::ble_scan_result_evt_p
|
||||
|
||||
while (offset + 2 < len) {
|
||||
const uint8_t field_length = payload[offset++]; // First byte is length of adv record
|
||||
if (field_length == 0)
|
||||
if (field_length == 0) {
|
||||
if (offset < param.adv_data_len && param.scan_rsp_len > 0) { // Zero padded advertisement data
|
||||
offset = param.adv_data_len;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte of adv record is adv record type
|
||||
const uint8_t record_type = payload[offset++];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "esphome/core/defines.h"
|
||||
#ifdef USE_ESP_IDF
|
||||
|
||||
#include <esp_task_wdt.h>
|
||||
|
||||
#include "ota_backend_esp_idf.h"
|
||||
#include "ota_component.h"
|
||||
#include <esp_ota_ops.h>
|
||||
@@ -14,7 +16,9 @@ OTAResponseTypes IDFOTABackend::begin(size_t image_size) {
|
||||
if (this->partition_ == nullptr) {
|
||||
return OTA_RESPONSE_ERROR_NO_UPDATE_PARTITION;
|
||||
}
|
||||
esp_task_wdt_init(15, false); // The following function takes longer than the 5 seconds timeout of WDT
|
||||
esp_err_t err = esp_ota_begin(this->partition_, image_size, &this->update_handle_);
|
||||
esp_task_wdt_init(CONFIG_ESP_TASK_WDT_TIMEOUT_S, false); // Set the WDT back to the configured timeout
|
||||
if (err != ESP_OK) {
|
||||
esp_ota_abort(this->update_handle_);
|
||||
this->update_handle_ = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2022.12.0b1"
|
||||
__version__ = "2022.12.0b5"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ pyserial==3.5
|
||||
platformio==6.1.5 # When updating platformio, also update Dockerfile
|
||||
esptool==4.4
|
||||
click==8.1.3
|
||||
esphome-dashboard==20221207.0
|
||||
esphome-dashboard==20221213.0
|
||||
aioesphomeapi==13.0.1
|
||||
zeroconf==0.39.4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user