mirror of
https://github.com/esphome/esphome.git
synced 2025-11-16 14:55:50 +00:00
Compare commits
18 Commits
2024.11.0b
...
2024.11.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a7d5dcad8 | ||
|
|
ef78c404dd | ||
|
|
01a24de3a8 | ||
|
|
ae46dcef7e | ||
|
|
872b8ee753 | ||
|
|
eb8a2326ad | ||
|
|
1ad535d030 | ||
|
|
1ed27b7cc0 | ||
|
|
585586780b | ||
|
|
50aeefc662 | ||
|
|
00465f4a6f | ||
|
|
f4dc11477f | ||
|
|
754352b4d7 | ||
|
|
67a4e56fcf | ||
|
|
9bc7b74d01 | ||
|
|
15bfc4c91f | ||
|
|
a0159a2746 | ||
|
|
44545a18a0 |
@@ -204,11 +204,11 @@ void BME68xBSEC2Component::update_subscription_() {
|
||||
}
|
||||
|
||||
void BME68xBSEC2Component::run_() {
|
||||
this->op_mode_ = this->bsec_settings_.op_mode;
|
||||
int64_t curr_time_ns = this->get_time_ns_();
|
||||
if (curr_time_ns < this->next_call_ns_) {
|
||||
if (curr_time_ns < this->bsec_settings_.next_call) {
|
||||
return;
|
||||
}
|
||||
this->op_mode_ = this->bsec_settings_.op_mode;
|
||||
uint8_t status;
|
||||
|
||||
ESP_LOGV(TAG, "Performing sensor run");
|
||||
@@ -219,57 +219,60 @@ void BME68xBSEC2Component::run_() {
|
||||
ESP_LOGW(TAG, "Failed to fetch sensor control settings (BSEC2 error code %d)", this->bsec_status_);
|
||||
return;
|
||||
}
|
||||
this->next_call_ns_ = this->bsec_settings_.next_call;
|
||||
|
||||
if (this->bsec_settings_.trigger_measurement) {
|
||||
bme68x_get_conf(&bme68x_conf, &this->bme68x_);
|
||||
switch (this->bsec_settings_.op_mode) {
|
||||
case BME68X_FORCED_MODE:
|
||||
bme68x_get_conf(&bme68x_conf, &this->bme68x_);
|
||||
|
||||
bme68x_conf.os_hum = this->bsec_settings_.humidity_oversampling;
|
||||
bme68x_conf.os_temp = this->bsec_settings_.temperature_oversampling;
|
||||
bme68x_conf.os_pres = this->bsec_settings_.pressure_oversampling;
|
||||
bme68x_set_conf(&bme68x_conf, &this->bme68x_);
|
||||
bme68x_conf.os_hum = this->bsec_settings_.humidity_oversampling;
|
||||
bme68x_conf.os_temp = this->bsec_settings_.temperature_oversampling;
|
||||
bme68x_conf.os_pres = this->bsec_settings_.pressure_oversampling;
|
||||
bme68x_set_conf(&bme68x_conf, &this->bme68x_);
|
||||
this->bme68x_heatr_conf_.enable = BME68X_ENABLE;
|
||||
this->bme68x_heatr_conf_.heatr_temp = this->bsec_settings_.heater_temperature;
|
||||
this->bme68x_heatr_conf_.heatr_dur = this->bsec_settings_.heater_duration;
|
||||
|
||||
// status = bme68x_set_op_mode(this->bsec_settings_.op_mode, &this->bme68x_);
|
||||
status = bme68x_set_heatr_conf(BME68X_FORCED_MODE, &this->bme68x_heatr_conf_, &this->bme68x_);
|
||||
status = bme68x_set_op_mode(BME68X_FORCED_MODE, &this->bme68x_);
|
||||
this->op_mode_ = BME68X_FORCED_MODE;
|
||||
ESP_LOGV(TAG, "Using forced mode");
|
||||
|
||||
break;
|
||||
case BME68X_PARALLEL_MODE:
|
||||
if (this->op_mode_ != this->bsec_settings_.op_mode) {
|
||||
bme68x_get_conf(&bme68x_conf, &this->bme68x_);
|
||||
|
||||
bme68x_conf.os_hum = this->bsec_settings_.humidity_oversampling;
|
||||
bme68x_conf.os_temp = this->bsec_settings_.temperature_oversampling;
|
||||
bme68x_conf.os_pres = this->bsec_settings_.pressure_oversampling;
|
||||
bme68x_set_conf(&bme68x_conf, &this->bme68x_);
|
||||
|
||||
switch (this->bsec_settings_.op_mode) {
|
||||
case BME68X_FORCED_MODE:
|
||||
this->bme68x_heatr_conf_.enable = BME68X_ENABLE;
|
||||
this->bme68x_heatr_conf_.heatr_temp = this->bsec_settings_.heater_temperature;
|
||||
this->bme68x_heatr_conf_.heatr_dur = this->bsec_settings_.heater_duration;
|
||||
this->bme68x_heatr_conf_.heatr_temp_prof = this->bsec_settings_.heater_temperature_profile;
|
||||
this->bme68x_heatr_conf_.heatr_dur_prof = this->bsec_settings_.heater_duration_profile;
|
||||
this->bme68x_heatr_conf_.profile_len = this->bsec_settings_.heater_profile_len;
|
||||
this->bme68x_heatr_conf_.shared_heatr_dur =
|
||||
BSEC_TOTAL_HEAT_DUR -
|
||||
(bme68x_get_meas_dur(BME68X_PARALLEL_MODE, &bme68x_conf, &this->bme68x_) / INT64_C(1000));
|
||||
|
||||
status = bme68x_set_op_mode(this->bsec_settings_.op_mode, &this->bme68x_);
|
||||
status = bme68x_set_heatr_conf(BME68X_FORCED_MODE, &this->bme68x_heatr_conf_, &this->bme68x_);
|
||||
status = bme68x_set_op_mode(BME68X_FORCED_MODE, &this->bme68x_);
|
||||
this->op_mode_ = BME68X_FORCED_MODE;
|
||||
this->sleep_mode_ = false;
|
||||
ESP_LOGV(TAG, "Using forced mode");
|
||||
status = bme68x_set_heatr_conf(BME68X_PARALLEL_MODE, &this->bme68x_heatr_conf_, &this->bme68x_);
|
||||
|
||||
break;
|
||||
case BME68X_PARALLEL_MODE:
|
||||
if (this->op_mode_ != this->bsec_settings_.op_mode) {
|
||||
this->bme68x_heatr_conf_.enable = BME68X_ENABLE;
|
||||
this->bme68x_heatr_conf_.heatr_temp_prof = this->bsec_settings_.heater_temperature_profile;
|
||||
this->bme68x_heatr_conf_.heatr_dur_prof = this->bsec_settings_.heater_duration_profile;
|
||||
this->bme68x_heatr_conf_.profile_len = this->bsec_settings_.heater_profile_len;
|
||||
this->bme68x_heatr_conf_.shared_heatr_dur =
|
||||
BSEC_TOTAL_HEAT_DUR -
|
||||
(bme68x_get_meas_dur(BME68X_PARALLEL_MODE, &bme68x_conf, &this->bme68x_) / INT64_C(1000));
|
||||
|
||||
status = bme68x_set_heatr_conf(BME68X_PARALLEL_MODE, &this->bme68x_heatr_conf_, &this->bme68x_);
|
||||
|
||||
status = bme68x_set_op_mode(BME68X_PARALLEL_MODE, &this->bme68x_);
|
||||
this->op_mode_ = BME68X_PARALLEL_MODE;
|
||||
this->sleep_mode_ = false;
|
||||
ESP_LOGV(TAG, "Using parallel mode");
|
||||
}
|
||||
break;
|
||||
case BME68X_SLEEP_MODE:
|
||||
if (!this->sleep_mode_) {
|
||||
bme68x_set_op_mode(BME68X_SLEEP_MODE, &this->bme68x_);
|
||||
this->sleep_mode_ = true;
|
||||
ESP_LOGV(TAG, "Using sleep mode");
|
||||
}
|
||||
break;
|
||||
}
|
||||
status = bme68x_set_op_mode(BME68X_PARALLEL_MODE, &this->bme68x_);
|
||||
this->op_mode_ = BME68X_PARALLEL_MODE;
|
||||
ESP_LOGV(TAG, "Using parallel mode");
|
||||
}
|
||||
break;
|
||||
case BME68X_SLEEP_MODE:
|
||||
if (this->op_mode_ != this->bsec_settings_.op_mode) {
|
||||
bme68x_set_op_mode(BME68X_SLEEP_MODE, &this->bme68x_);
|
||||
this->op_mode_ = BME68X_SLEEP_MODE;
|
||||
ESP_LOGV(TAG, "Using sleep mode");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->bsec_settings_.trigger_measurement && this->bsec_settings_.op_mode != BME68X_SLEEP_MODE) {
|
||||
uint32_t meas_dur = 0;
|
||||
meas_dur = bme68x_get_meas_dur(this->op_mode_, &bme68x_conf, &this->bme68x_);
|
||||
ESP_LOGV(TAG, "Queueing read in %uus", meas_dur);
|
||||
|
||||
@@ -113,13 +113,11 @@ class BME68xBSEC2Component : public Component {
|
||||
|
||||
struct bme68x_heatr_conf bme68x_heatr_conf_;
|
||||
uint8_t op_mode_; // operating mode of sensor
|
||||
bool sleep_mode_;
|
||||
bsec_library_return_t bsec_status_{BSEC_OK};
|
||||
int8_t bme68x_status_{BME68X_OK};
|
||||
|
||||
int64_t last_time_ms_{0};
|
||||
uint32_t millis_overflow_counter_{0};
|
||||
int64_t next_call_ns_{0};
|
||||
|
||||
std::queue<std::function<void()>> queue_;
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ void ESP32BLETracker::setup() {
|
||||
[this](ota::OTAState state, float progress, uint8_t error, ota::OTAComponent *comp) {
|
||||
if (state == ota::OTA_STARTED) {
|
||||
this->stop_scan();
|
||||
for (auto *client : this->clients_) {
|
||||
client->disconnect();
|
||||
}
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
@@ -104,7 +104,9 @@ std::shared_ptr<HttpContainer> HttpRequestArduino::start(std::string url, std::s
|
||||
static const size_t HEADER_COUNT = sizeof(header_keys) / sizeof(header_keys[0]);
|
||||
container->client_.collectHeaders(header_keys, HEADER_COUNT);
|
||||
|
||||
App.feed_wdt();
|
||||
container->status_code = container->client_.sendRequest(method.c_str(), body.c_str());
|
||||
App.feed_wdt();
|
||||
if (container->status_code < 0) {
|
||||
ESP_LOGW(TAG, "HTTP Request failed; URL: %s; Error: %s", url.c_str(),
|
||||
HTTPClient::errorToString(container->status_code).c_str());
|
||||
|
||||
@@ -117,8 +117,11 @@ std::shared_ptr<HttpContainer> HttpRequestIDF::start(std::string url, std::strin
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
App.feed_wdt();
|
||||
container->content_length = esp_http_client_fetch_headers(client);
|
||||
App.feed_wdt();
|
||||
container->status_code = esp_http_client_get_status_code(client);
|
||||
App.feed_wdt();
|
||||
if (is_success(container->status_code)) {
|
||||
container->duration_ms = millis() - start;
|
||||
return container;
|
||||
@@ -148,8 +151,11 @@ std::shared_ptr<HttpContainer> HttpRequestIDF::start(std::string url, std::strin
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
App.feed_wdt();
|
||||
container->content_length = esp_http_client_fetch_headers(client);
|
||||
App.feed_wdt();
|
||||
container->status_code = esp_http_client_get_status_code(client);
|
||||
App.feed_wdt();
|
||||
if (is_success(container->status_code)) {
|
||||
container->duration_ms = millis() - start;
|
||||
return container;
|
||||
|
||||
@@ -99,14 +99,6 @@ void I2SAudioSpeaker::setup() {
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
|
||||
this->i2s_event_queue_ = xQueueCreate(I2S_EVENT_QUEUE_COUNT, sizeof(i2s_event_t));
|
||||
|
||||
if (this->i2s_event_queue_ == nullptr) {
|
||||
ESP_LOGE(TAG, "Failed to create I2S event queue");
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void I2SAudioSpeaker::loop() {
|
||||
@@ -339,7 +331,7 @@ void I2SAudioSpeaker::speaker_task(void *params) {
|
||||
}
|
||||
|
||||
void I2SAudioSpeaker::start() {
|
||||
if (this->is_failed() || this->status_has_error())
|
||||
if (!this->is_ready() || this->is_failed() || this->status_has_error())
|
||||
return;
|
||||
if ((this->state_ == speaker::STATE_STARTING) || (this->state_ == speaker::STATE_RUNNING))
|
||||
return;
|
||||
@@ -519,7 +511,6 @@ void I2SAudioSpeaker::delete_task_(size_t buffer_size) {
|
||||
}
|
||||
|
||||
xEventGroupSetBits(this->event_group_, SpeakerEventGroupBits::STATE_STOPPED);
|
||||
xQueueReset(this->i2s_event_queue_);
|
||||
|
||||
this->task_created_ = false;
|
||||
vTaskDelete(nullptr);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace i2s_audio {
|
||||
|
||||
class I2SAudioSpeaker : public I2SAudioOut, public speaker::Speaker, public Component {
|
||||
public:
|
||||
float get_setup_priority() const override { return esphome::setup_priority::LATE; }
|
||||
float get_setup_priority() const override { return esphome::setup_priority::PROCESSOR; }
|
||||
|
||||
void setup() override;
|
||||
void loop() override;
|
||||
|
||||
@@ -180,7 +180,7 @@ void LD2420Component::apply_config_action() {
|
||||
}
|
||||
|
||||
void LD2420Component::factory_reset_action() {
|
||||
ESP_LOGCONFIG(TAG, "Setiing factory defaults...");
|
||||
ESP_LOGCONFIG(TAG, "Setting factory defaults...");
|
||||
if (this->set_config_mode(true) == LD2420_ERROR_TIMEOUT) {
|
||||
ESP_LOGE(TAG, "LD2420 module has failed to respond, check baud rate and serial connections.");
|
||||
this->mark_failed();
|
||||
|
||||
@@ -38,7 +38,7 @@ void SDMMeter::on_modbus_data(const std::vector<uint8_t> &data) {
|
||||
|
||||
ESP_LOGD(
|
||||
TAG,
|
||||
"SDMMeter Phase %c: V=%.3f V, I=%.3f A, Active P=%.3f W, Apparent P=%.3f VA, Reactive P=%.3f VAR, PF=%.3f, "
|
||||
"SDMMeter Phase %c: V=%.3f V, I=%.3f A, Active P=%.3f W, Apparent P=%.3f VA, Reactive P=%.3f var, PF=%.3f, "
|
||||
"PA=%.3f °",
|
||||
i + 'A', voltage, current, active_power, apparent_power, reactive_power, power_factor, phase_angle);
|
||||
if (phase.voltage_sensor_ != nullptr)
|
||||
|
||||
@@ -86,7 +86,7 @@ void TuyaFan::control(const fan::FanCall &call) {
|
||||
if (this->oscillation_id_.has_value() && call.get_oscillating().has_value()) {
|
||||
if (this->oscillation_type_ == TuyaDatapointType::ENUM) {
|
||||
this->parent_->set_enum_datapoint_value(*this->oscillation_id_, *call.get_oscillating());
|
||||
} else if (this->speed_type_ == TuyaDatapointType::BOOLEAN) {
|
||||
} else if (this->oscillation_type_ == TuyaDatapointType::BOOLEAN) {
|
||||
this->parent_->set_boolean_datapoint_value(*this->oscillation_id_, *call.get_oscillating());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2024.11.0b1"
|
||||
__version__ = "2024.11.0"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||
@@ -1095,7 +1095,7 @@ UNIT_STEPS = "steps"
|
||||
UNIT_VOLT = "V"
|
||||
UNIT_VOLT_AMPS = "VA"
|
||||
UNIT_VOLT_AMPS_HOURS = "VAh"
|
||||
UNIT_VOLT_AMPS_REACTIVE = "VAR"
|
||||
UNIT_VOLT_AMPS_REACTIVE = "var"
|
||||
UNIT_VOLT_AMPS_REACTIVE_HOURS = "VARh"
|
||||
UNIT_WATT = "W"
|
||||
UNIT_WATT_HOURS = "Wh"
|
||||
|
||||
@@ -12,7 +12,7 @@ pyserial==3.5
|
||||
platformio==6.1.16 # When updating platformio, also update Dockerfile
|
||||
esptool==4.7.0
|
||||
click==8.1.7
|
||||
esphome-dashboard==20241025.0
|
||||
esphome-dashboard==20241120.0
|
||||
aioesphomeapi==24.6.2
|
||||
zeroconf==0.132.2
|
||||
puremagic==1.27
|
||||
|
||||
@@ -39,3 +39,10 @@ esp32_ble_tracker:
|
||||
- then:
|
||||
- lambda: |-
|
||||
ESP_LOGD("ble_auto", "The scan has ended!");
|
||||
|
||||
wifi:
|
||||
ssid: MySSID
|
||||
password: password1
|
||||
|
||||
ota:
|
||||
- platform: esphome
|
||||
|
||||
Reference in New Issue
Block a user