mirror of
https://github.com/esphome/esphome.git
synced 2025-11-02 16:11:53 +00:00
Compare commits
37 Commits
2022.12.0b
...
2022.12.0
Author | SHA1 | Date | |
---|---|---|---|
|
84374b6b1e | ||
|
391316c9b5 | ||
|
705c62ebd7 | ||
|
cb520c00a5 | ||
|
2f24138345 | ||
|
96512b80cc | ||
|
fcb9b51978 | ||
|
f408f1a368 | ||
|
7d8d563c62 | ||
|
0a1f705fda | ||
|
1952c1880b | ||
|
b03967dac1 | ||
|
bcae2596a6 | ||
|
fc0347c86c | ||
|
7209dd8bae | ||
|
ab736c89bb | ||
|
6911639617 | ||
|
b9720d0715 | ||
|
47b3267ed4 | ||
|
e16ba2adb5 | ||
|
0a19b1e32c | ||
|
bae9a950c0 | ||
|
72b2943332 | ||
|
4ec0ef7548 | ||
|
25bc6761f6 | ||
|
81b6562c25 | ||
|
ae74189fc2 | ||
|
9e516efe10 | ||
|
366e29439e | ||
|
1c9c700d7f | ||
|
b2e6b9d31f | ||
|
7623f63846 | ||
|
2bfaf9dce3 | ||
|
5c2c1560bb | ||
|
f7096ab78e | ||
|
98f8feb625 | ||
|
9944ca414e |
@@ -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,
|
||||
@@ -288,14 +290,17 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) {
|
||||
if (length > 2) {
|
||||
return (float) encode_uint16(value[1], value[2]);
|
||||
}
|
||||
// fall through
|
||||
case 0x7: // uint24.
|
||||
if (length > 3) {
|
||||
return (float) encode_uint24(value[1], value[2], value[3]);
|
||||
}
|
||||
// fall through
|
||||
case 0x8: // uint32.
|
||||
if (length > 4) {
|
||||
return (float) encode_uint32(value[1], value[2], value[3], value[4]);
|
||||
}
|
||||
// fall through
|
||||
case 0xC: // int8.
|
||||
return (float) ((int8_t) value[1]);
|
||||
case 0xD: // int12.
|
||||
@@ -303,10 +308,12 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) {
|
||||
if (length > 2) {
|
||||
return (float) ((int16_t)(value[1] << 8) + (int16_t) value[2]);
|
||||
}
|
||||
// fall through
|
||||
case 0xF: // int24.
|
||||
if (length > 3) {
|
||||
return (float) ((int32_t)(value[1] << 16) + (int32_t)(value[2] << 8) + (int32_t)(value[3]));
|
||||
}
|
||||
// fall through
|
||||
case 0x10: // int32.
|
||||
if (length > 4) {
|
||||
return (float) ((int32_t)(value[1] << 24) + (int32_t)(value[2] << 16) + (int32_t)(value[3] << 8) +
|
||||
|
@@ -54,7 +54,11 @@ void ESP32Camera::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, " HREF Pin: %d", conf.pin_href);
|
||||
ESP_LOGCONFIG(TAG, " Pixel Clock Pin: %d", conf.pin_pclk);
|
||||
ESP_LOGCONFIG(TAG, " External Clock: Pin:%d Frequency:%u", conf.pin_xclk, conf.xclk_freq_hz);
|
||||
#ifdef USE_ESP_IDF // Temporary until the espressif/esp32-camera library is updated
|
||||
ESP_LOGCONFIG(TAG, " I2C Pins: SDA:%d SCL:%d", conf.pin_sscb_sda, conf.pin_sscb_scl);
|
||||
#else
|
||||
ESP_LOGCONFIG(TAG, " I2C Pins: SDA:%d SCL:%d", conf.pin_sccb_sda, conf.pin_sccb_scl);
|
||||
#endif
|
||||
ESP_LOGCONFIG(TAG, " Reset Pin: %d", conf.pin_reset);
|
||||
switch (this->config_.frame_size) {
|
||||
case FRAMESIZE_QQVGA:
|
||||
@@ -209,8 +213,13 @@ void ESP32Camera::set_external_clock(uint8_t pin, uint32_t frequency) {
|
||||
this->config_.xclk_freq_hz = frequency;
|
||||
}
|
||||
void ESP32Camera::set_i2c_pins(uint8_t sda, uint8_t scl) {
|
||||
#ifdef USE_ESP_IDF // Temporary until the espressif/esp32-camera library is updated
|
||||
this->config_.pin_sscb_sda = sda;
|
||||
this->config_.pin_sscb_scl = scl;
|
||||
#else
|
||||
this->config_.pin_sccb_sda = sda;
|
||||
this->config_.pin_sccb_scl = scl;
|
||||
#endif
|
||||
}
|
||||
void ESP32Camera::set_reset_pin(uint8_t pin) { this->config_.pin_reset = pin; }
|
||||
void ESP32Camera::set_power_down_pin(uint8_t pin) { this->config_.pin_pwdn = pin; }
|
||||
|
@@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2022.12.0b3"
|
||||
__version__ = "2022.12.0"
|
||||
|
||||
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