mirror of
https://github.com/esphome/esphome.git
synced 2025-01-18 18:35:59 +01:00
commit
97e067a277
6 changed files with 24 additions and 13 deletions
|
@ -163,7 +163,7 @@ void BME280Component::setup() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
config_register &= ~0b11111100;
|
config_register &= ~0b11111100;
|
||||||
config_register |= 0b000 << 5; // 0.5 ms standby time
|
config_register |= 0b101 << 5; // 1000 ms standby time
|
||||||
config_register |= (this->iir_filter_ & 0b111) << 2;
|
config_register |= (this->iir_filter_ & 0b111) << 2;
|
||||||
if (!this->write_byte(BME280_REGISTER_CONFIG, config_register)) {
|
if (!this->write_byte(BME280_REGISTER_CONFIG, config_register)) {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
|
|
|
@ -227,7 +227,18 @@ optional<ProntoData> ProntoProtocol::decode(RemoteReceiveData src) {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProntoProtocol::dump(const ProntoData &data) { ESP_LOGD(TAG, "Received Pronto: data=%s", data.data.c_str()); }
|
void ProntoProtocol::dump(const ProntoData &data) {
|
||||||
|
std::string first, rest;
|
||||||
|
if (data.data.size() < 230) {
|
||||||
|
first = data.data;
|
||||||
|
} else {
|
||||||
|
first = data.data.substr(0, 229);
|
||||||
|
rest = data.data.substr(230);
|
||||||
|
}
|
||||||
|
ESP_LOGD(TAG, "Received Pronto: data=%s", first.c_str());
|
||||||
|
if (!rest.empty())
|
||||||
|
ESP_LOGD(TAG, "%s", rest.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace remote_base
|
} // namespace remote_base
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
|
@ -769,7 +769,7 @@ void Sprinkler::resume() {
|
||||||
ESP_LOGD(TAG, "Resuming valve %u with %u seconds remaining", this->paused_valve_.value_or(0),
|
ESP_LOGD(TAG, "Resuming valve %u with %u seconds remaining", this->paused_valve_.value_or(0),
|
||||||
this->resume_duration_.value_or(0));
|
this->resume_duration_.value_or(0));
|
||||||
this->fsm_request_(this->paused_valve_.value(), this->resume_duration_.value());
|
this->fsm_request_(this->paused_valve_.value(), this->resume_duration_.value());
|
||||||
this->reset_resume_();
|
this->reset_resume();
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGD(TAG, "No valve to resume!");
|
ESP_LOGD(TAG, "No valve to resume!");
|
||||||
}
|
}
|
||||||
|
@ -783,6 +783,11 @@ void Sprinkler::resume_or_start_full_cycle() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sprinkler::reset_resume() {
|
||||||
|
this->paused_valve_.reset();
|
||||||
|
this->resume_duration_.reset();
|
||||||
|
}
|
||||||
|
|
||||||
const char *Sprinkler::valve_name(const size_t valve_number) {
|
const char *Sprinkler::valve_name(const size_t valve_number) {
|
||||||
if (this->is_a_valid_valve(valve_number)) {
|
if (this->is_a_valid_valve(valve_number)) {
|
||||||
return this->valve_[valve_number].controller_switch->get_name().c_str();
|
return this->valve_[valve_number].controller_switch->get_name().c_str();
|
||||||
|
@ -1101,11 +1106,6 @@ void Sprinkler::reset_cycle_states_() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sprinkler::reset_resume_() {
|
|
||||||
this->paused_valve_.reset();
|
|
||||||
this->resume_duration_.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sprinkler::fsm_request_(size_t requested_valve, uint32_t requested_run_duration) {
|
void Sprinkler::fsm_request_(size_t requested_valve, uint32_t requested_run_duration) {
|
||||||
this->next_req_.set_valve(requested_valve);
|
this->next_req_.set_valve(requested_valve);
|
||||||
this->next_req_.set_run_duration(requested_run_duration);
|
this->next_req_.set_run_duration(requested_run_duration);
|
||||||
|
|
|
@ -308,6 +308,9 @@ class Sprinkler : public Component, public EntityBase {
|
||||||
/// if a cycle was suspended using pause(), resumes it. otherwise calls start_full_cycle()
|
/// if a cycle was suspended using pause(), resumes it. otherwise calls start_full_cycle()
|
||||||
void resume_or_start_full_cycle();
|
void resume_or_start_full_cycle();
|
||||||
|
|
||||||
|
/// resets resume state
|
||||||
|
void reset_resume();
|
||||||
|
|
||||||
/// returns a pointer to a valve's name string object; returns nullptr if valve_number is invalid
|
/// returns a pointer to a valve's name string object; returns nullptr if valve_number is invalid
|
||||||
const char *valve_name(size_t valve_number);
|
const char *valve_name(size_t valve_number);
|
||||||
|
|
||||||
|
@ -401,9 +404,6 @@ class Sprinkler : public Component, public EntityBase {
|
||||||
/// resets the cycle state for all valves
|
/// resets the cycle state for all valves
|
||||||
void reset_cycle_states_();
|
void reset_cycle_states_();
|
||||||
|
|
||||||
/// resets resume state
|
|
||||||
void reset_resume_();
|
|
||||||
|
|
||||||
/// make a request of the state machine
|
/// make a request of the state machine
|
||||||
void fsm_request_(size_t requested_valve, uint32_t requested_run_duration = 0);
|
void fsm_request_(size_t requested_valve, uint32_t requested_run_duration = 0);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2022.9.0b2"
|
__version__ = "2022.9.0b3"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ pyserial==3.5
|
||||||
platformio==6.0.2 # When updating platformio, also update Dockerfile
|
platformio==6.0.2 # When updating platformio, also update Dockerfile
|
||||||
esptool==3.3.1
|
esptool==3.3.1
|
||||||
click==8.1.3
|
click==8.1.3
|
||||||
esphome-dashboard==20220508.0
|
esphome-dashboard==20220919.1
|
||||||
aioesphomeapi==10.13.0
|
aioesphomeapi==10.13.0
|
||||||
zeroconf==0.39.1
|
zeroconf==0.39.1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue