mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
commit
156d2c04f9
7 changed files with 38 additions and 31 deletions
|
@ -13,29 +13,29 @@ void AdE7953I2c::dump_config() {
|
||||||
ade7953_base::ADE7953::dump_config();
|
ade7953_base::ADE7953::dump_config();
|
||||||
}
|
}
|
||||||
bool AdE7953I2c::ade_write_8(uint16_t reg, uint8_t value) {
|
bool AdE7953I2c::ade_write_8(uint16_t reg, uint8_t value) {
|
||||||
std::vector<uint8_t> data(3);
|
uint8_t data[3];
|
||||||
data.push_back(reg >> 8);
|
data[0] = reg >> 8;
|
||||||
data.push_back(reg >> 0);
|
data[1] = reg >> 0;
|
||||||
data.push_back(value);
|
data[2] = value;
|
||||||
return this->write(data.data(), data.size()) != i2c::ERROR_OK;
|
return this->write(data, 3) != i2c::ERROR_OK;
|
||||||
}
|
}
|
||||||
bool AdE7953I2c::ade_write_16(uint16_t reg, uint16_t value) {
|
bool AdE7953I2c::ade_write_16(uint16_t reg, uint16_t value) {
|
||||||
std::vector<uint8_t> data(4);
|
uint8_t data[4];
|
||||||
data.push_back(reg >> 8);
|
data[0] = reg >> 8;
|
||||||
data.push_back(reg >> 0);
|
data[1] = reg >> 0;
|
||||||
data.push_back(value >> 8);
|
data[2] = value >> 8;
|
||||||
data.push_back(value >> 0);
|
data[3] = value >> 0;
|
||||||
return this->write(data.data(), data.size()) != i2c::ERROR_OK;
|
return this->write(data, 4) != i2c::ERROR_OK;
|
||||||
}
|
}
|
||||||
bool AdE7953I2c::ade_write_32(uint16_t reg, uint32_t value) {
|
bool AdE7953I2c::ade_write_32(uint16_t reg, uint32_t value) {
|
||||||
std::vector<uint8_t> data(6);
|
uint8_t data[6];
|
||||||
data.push_back(reg >> 8);
|
data[0] = reg >> 8;
|
||||||
data.push_back(reg >> 0);
|
data[1] = reg >> 0;
|
||||||
data.push_back(value >> 24);
|
data[2] = value >> 24;
|
||||||
data.push_back(value >> 16);
|
data[3] = value >> 16;
|
||||||
data.push_back(value >> 8);
|
data[4] = value >> 8;
|
||||||
data.push_back(value >> 0);
|
data[5] = value >> 0;
|
||||||
return this->write(data.data(), data.size()) != i2c::ERROR_OK;
|
return this->write(data, 6) != i2c::ERROR_OK;
|
||||||
}
|
}
|
||||||
bool AdE7953I2c::ade_read_8(uint16_t reg, uint8_t *value) {
|
bool AdE7953I2c::ade_read_8(uint16_t reg, uint8_t *value) {
|
||||||
uint8_t reg_data[2];
|
uint8_t reg_data[2];
|
||||||
|
|
|
@ -211,10 +211,11 @@ void LD2420Component::factory_reset_action() {
|
||||||
void LD2420Component::restart_module_action() {
|
void LD2420Component::restart_module_action() {
|
||||||
ESP_LOGCONFIG(TAG, "Restarting LD2420 module...");
|
ESP_LOGCONFIG(TAG, "Restarting LD2420 module...");
|
||||||
this->send_module_restart();
|
this->send_module_restart();
|
||||||
delay_microseconds_safe(45000);
|
this->set_timeout(250, [this]() {
|
||||||
this->set_config_mode(true);
|
this->set_config_mode(true);
|
||||||
this->set_system_mode(system_mode_);
|
this->set_system_mode(system_mode_);
|
||||||
this->set_config_mode(false);
|
this->set_config_mode(false);
|
||||||
|
});
|
||||||
ESP_LOGCONFIG(TAG, "LD2420 Restarted.");
|
ESP_LOGCONFIG(TAG, "LD2420 Restarted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,18 +528,16 @@ int LD2420Component::send_cmd_from_array(CmdFrameT frame) {
|
||||||
this->write_byte(cmd_buffer[index]);
|
this->write_byte(cmd_buffer[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
delay_microseconds_safe(500); // give the module a moment to process it
|
|
||||||
error = 0;
|
error = 0;
|
||||||
if (frame.command == CMD_RESTART) {
|
if (frame.command == CMD_RESTART) {
|
||||||
delay_microseconds_safe(25000); // Wait for the restart
|
return 0; // restart does not reply exit now
|
||||||
return 0; // restart does not reply exit now
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!this->cmd_reply_.ack) {
|
while (!this->cmd_reply_.ack) {
|
||||||
while (available()) {
|
while (available()) {
|
||||||
this->readline_(read(), ack_buffer, sizeof(ack_buffer));
|
this->readline_(read(), ack_buffer, sizeof(ack_buffer));
|
||||||
}
|
}
|
||||||
delay_microseconds_safe(250);
|
delay_microseconds_safe(1450);
|
||||||
if (loop_count <= 0) {
|
if (loop_count <= 0) {
|
||||||
error = LD2420_ERROR_TIMEOUT;
|
error = LD2420_ERROR_TIMEOUT;
|
||||||
retry--;
|
retry--;
|
||||||
|
|
|
@ -16,7 +16,7 @@ RemoteRMTChannel::RemoteRMTChannel(uint8_t mem_block_num) : mem_block_num_(mem_b
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteRMTChannel::config_rmt(rmt_config_t &rmt) {
|
void RemoteRMTChannel::config_rmt(rmt_config_t &rmt) {
|
||||||
if (rmt_channel_t(int(this->channel_) + this->mem_block_num_) >= RMT_CHANNEL_MAX) {
|
if (rmt_channel_t(int(this->channel_) + this->mem_block_num_) > RMT_CHANNEL_MAX) {
|
||||||
this->mem_block_num_ = int(RMT_CHANNEL_MAX) - int(this->channel_);
|
this->mem_block_num_ = int(RMT_CHANNEL_MAX) - int(this->channel_);
|
||||||
ESP_LOGW(TAG, "Not enough RMT memory blocks available, reduced to %i blocks.", this->mem_block_num_);
|
ESP_LOGW(TAG, "Not enough RMT memory blocks available, reduced to %i blocks.", this->mem_block_num_);
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,9 @@ bool UponorSmatrixComponent::send(uint16_t device_address, const UponorSmatrixDa
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Assemble packet for send queue. All fields are big-endian except for the little-endian checksum.
|
// Assemble packet for send queue. All fields are big-endian except for the little-endian checksum.
|
||||||
std::vector<uint8_t> packet(6 + 3 * data_len);
|
std::vector<uint8_t> packet;
|
||||||
|
packet.reserve(6 + 3 * data_len);
|
||||||
|
|
||||||
packet.push_back(this->address_ >> 8);
|
packet.push_back(this->address_ >> 8);
|
||||||
packet.push_back(this->address_ >> 0);
|
packet.push_back(this->address_ >> 0);
|
||||||
packet.push_back(device_address >> 8);
|
packet.push_back(device_address >> 8);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2024.3.0b3"
|
__version__ = "2024.3.0b4"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
|
|
@ -688,6 +688,11 @@ class MainRequestHandler(BaseHandler):
|
||||||
@authenticated
|
@authenticated
|
||||||
def get(self) -> None:
|
def get(self) -> None:
|
||||||
begin = bool(self.get_argument("begin", False))
|
begin = bool(self.get_argument("begin", False))
|
||||||
|
if settings.using_password:
|
||||||
|
# Simply accessing the xsrf_token sets the cookie for us
|
||||||
|
self.xsrf_token # pylint: disable=pointless-statement
|
||||||
|
else:
|
||||||
|
self.clear_cookie("_xsrf")
|
||||||
|
|
||||||
self.render(
|
self.render(
|
||||||
"index.template.html",
|
"index.template.html",
|
||||||
|
@ -1102,6 +1107,7 @@ def make_app(debug=get_bool_env(ENV_DEV)) -> tornado.web.Application:
|
||||||
"log_function": log_function,
|
"log_function": log_function,
|
||||||
"websocket_ping_interval": 30.0,
|
"websocket_ping_interval": 30.0,
|
||||||
"template_path": get_base_frontend_path(),
|
"template_path": get_base_frontend_path(),
|
||||||
|
"xsrf_cookies": settings.using_password,
|
||||||
}
|
}
|
||||||
rel = settings.relative_url
|
rel = settings.relative_url
|
||||||
return tornado.web.Application(
|
return tornado.web.Application(
|
||||||
|
|
|
@ -12,7 +12,7 @@ pyserial==3.5
|
||||||
platformio==6.1.13 # When updating platformio, also update Dockerfile
|
platformio==6.1.13 # When updating platformio, also update Dockerfile
|
||||||
esptool==4.7.0
|
esptool==4.7.0
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
esphome-dashboard==20231107.0
|
esphome-dashboard==20240319.0
|
||||||
aioesphomeapi==23.1.1
|
aioesphomeapi==23.1.1
|
||||||
zeroconf==0.131.0
|
zeroconf==0.131.0
|
||||||
python-magic==0.4.27
|
python-magic==0.4.27
|
||||||
|
|
Loading…
Reference in a new issue