mirror of
https://github.com/esphome/esphome.git
synced 2026-02-28 18:04:19 -07:00
Merge branch 'integration' into memory_api
This commit is contained in:
@@ -77,6 +77,9 @@ void BLESensor::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t ga
|
||||
}
|
||||
} else {
|
||||
this->node_state = espbt::ClientState::ESTABLISHED;
|
||||
// For non-notify characteristics, trigger an immediate read after service discovery
|
||||
// to avoid peripherals disconnecting due to inactivity
|
||||
this->update();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,9 @@ void BLETextSensor::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
|
||||
}
|
||||
} else {
|
||||
this->node_state = espbt::ClientState::ESTABLISHED;
|
||||
// For non-notify characteristics, trigger an immediate read after service discovery
|
||||
// to avoid peripherals disconnecting due to inactivity
|
||||
this->update();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -121,10 +121,13 @@ void FanRestoreState::apply(Fan &fan) {
|
||||
fan.speed = this->speed;
|
||||
fan.direction = this->direction;
|
||||
|
||||
// Use stored preset index to get preset name from traits
|
||||
const auto &preset_modes = fan.get_traits().supported_preset_modes();
|
||||
if (this->preset_mode < preset_modes.size()) {
|
||||
fan.set_preset_mode_(preset_modes[this->preset_mode]);
|
||||
auto traits = fan.get_traits();
|
||||
if (traits.supports_preset_modes()) {
|
||||
// Use stored preset index to get preset name from traits
|
||||
const auto &preset_modes = traits.supported_preset_modes();
|
||||
if (this->preset_mode < preset_modes.size()) {
|
||||
fan.set_preset_mode_(preset_modes[this->preset_mode]);
|
||||
}
|
||||
}
|
||||
|
||||
fan.publish_state();
|
||||
@@ -228,7 +231,7 @@ void Fan::save_state_() {
|
||||
state.direction = this->direction;
|
||||
|
||||
const char *preset = this->get_preset_mode();
|
||||
if (preset != nullptr) {
|
||||
if (traits.supports_preset_modes() && preset != nullptr) {
|
||||
const auto &preset_modes = traits.supported_preset_modes();
|
||||
// Find index of current preset mode (pointer comparison is safe since preset is from traits)
|
||||
for (size_t i = 0; i < preset_modes.size(); i++) {
|
||||
|
||||
@@ -21,12 +21,12 @@ font:
|
||||
id: roboto_greek
|
||||
size: 20
|
||||
glyphs: ["\u0300", "\u00C5", "\U000000C7"]
|
||||
- file: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
- file: "https://media.esphome.io/tests/fonts/Monocraft.ttf"
|
||||
id: monocraft
|
||||
size: 20
|
||||
- file:
|
||||
type: web
|
||||
url: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
url: "https://media.esphome.io/tests/fonts/Monocraft.ttf"
|
||||
id: monocraft2
|
||||
size: 24
|
||||
- file: $component_dir/Monocraft.ttf
|
||||
|
||||
@@ -21,12 +21,12 @@ font:
|
||||
id: roboto_greek
|
||||
size: 20
|
||||
glyphs: ["\u0300", "\u00C5", "\U000000C7"]
|
||||
- file: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
- file: "https://media.esphome.io/tests/fonts/Monocraft.ttf"
|
||||
id: monocraft
|
||||
size: 20
|
||||
- file:
|
||||
type: web
|
||||
url: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
|
||||
url: "https://media.esphome.io/tests/fonts/Monocraft.ttf"
|
||||
id: monocraft2
|
||||
size: 24
|
||||
- file: $component_dir/Monocraft.ttf
|
||||
|
||||
@@ -50,16 +50,16 @@ image:
|
||||
transparency: opaque
|
||||
|
||||
- id: web_svg_image
|
||||
file: https://raw.githubusercontent.com/esphome/esphome-docs/a62d7ab193c1a464ed791670170c7d518189109b/images/logo.svg
|
||||
file: https://media.esphome.io/logo/logo.svg
|
||||
resize: 256x48
|
||||
type: BINARY
|
||||
transparency: chroma_key
|
||||
- id: web_tiff_image
|
||||
file: https://upload.wikimedia.org/wikipedia/commons/b/b6/SIPI_Jelly_Beans_4.1.07.tiff
|
||||
file: https://media.esphome.io/tests/images/SIPI_Jelly_Beans_4.1.07.tiff
|
||||
type: RGB
|
||||
resize: 48x48
|
||||
- id: web_redirect_image
|
||||
file: https://avatars.githubusercontent.com/u/3060199?s=48&v=4
|
||||
file: https://media.esphome.io/logo/logo.png
|
||||
type: RGB
|
||||
resize: 48x48
|
||||
- id: mdi_alert
|
||||
|
||||
Reference in New Issue
Block a user