mirror of
https://github.com/esphome/esphome.git
synced 2025-01-24 21:34:26 +01:00
Merge pull request #7599 from esphome/bump-2024.10.0b2
Some checks failed
CI / Create common environment (push) Has been cancelled
YAML lint / yamllint (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check black (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run pytest (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / list-components (push) Has been cancelled
CI / Component test (push) Has been cancelled
CI / Split components for testing into 20 groups maximum (push) Has been cancelled
CI / Test split components (push) Has been cancelled
CI / CI Status (push) Has been cancelled
Some checks failed
CI / Create common environment (push) Has been cancelled
YAML lint / yamllint (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check black (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run pytest (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / list-components (push) Has been cancelled
CI / Component test (push) Has been cancelled
CI / Split components for testing into 20 groups maximum (push) Has been cancelled
CI / Test split components (push) Has been cancelled
CI / CI Status (push) Has been cancelled
2024.10.0b2
This commit is contained in:
commit
ef87a6657a
8 changed files with 76 additions and 54 deletions
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
|
@ -315,7 +315,9 @@ jobs:
|
||||||
key: platformio-${{ matrix.pio_cache_key }}
|
key: platformio-${{ matrix.pio_cache_key }}
|
||||||
|
|
||||||
- name: Install clang-tidy
|
- name: Install clang-tidy
|
||||||
run: sudo apt-get install clang-tidy-14
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install clang-tidy-14
|
||||||
|
|
||||||
- name: Register problem matchers
|
- name: Register problem matchers
|
||||||
run: |
|
run: |
|
||||||
|
@ -397,7 +399,9 @@ jobs:
|
||||||
file: ${{ fromJson(needs.list-components.outputs.components) }}
|
file: ${{ fromJson(needs.list-components.outputs.components) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get install libsdl2-dev
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install libsdl2-dev
|
||||||
|
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.1.7
|
||||||
|
@ -451,7 +455,9 @@ jobs:
|
||||||
run: echo ${{ matrix.components }}
|
run: echo ${{ matrix.components }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get install libsdl2-dev
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install libsdl2-dev
|
||||||
|
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
|
@ -244,7 +244,7 @@ void CSE7766Component::dump_config() {
|
||||||
LOG_SENSOR(" ", "Apparent Power", this->apparent_power_sensor_);
|
LOG_SENSOR(" ", "Apparent Power", this->apparent_power_sensor_);
|
||||||
LOG_SENSOR(" ", "Reactive Power", this->reactive_power_sensor_);
|
LOG_SENSOR(" ", "Reactive Power", this->reactive_power_sensor_);
|
||||||
LOG_SENSOR(" ", "Power Factor", this->power_factor_sensor_);
|
LOG_SENSOR(" ", "Power Factor", this->power_factor_sensor_);
|
||||||
this->check_uart_settings(4800);
|
this->check_uart_settings(4800, 1, uart::UART_CONFIG_PARITY_EVEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace cse7766
|
} // namespace cse7766
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import mqtt
|
from esphome.components import mqtt, web_server
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
|
@ -11,6 +11,7 @@ from esphome.const import (
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
CONF_ON_EVENT,
|
CONF_ON_EVENT,
|
||||||
CONF_TRIGGER_ID,
|
CONF_TRIGGER_ID,
|
||||||
|
CONF_WEB_SERVER,
|
||||||
DEVICE_CLASS_BUTTON,
|
DEVICE_CLASS_BUTTON,
|
||||||
DEVICE_CLASS_DOORBELL,
|
DEVICE_CLASS_DOORBELL,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
|
@ -40,7 +41,10 @@ EventTrigger = event_ns.class_("EventTrigger", automation.Trigger.template())
|
||||||
|
|
||||||
validate_device_class = cv.one_of(*DEVICE_CLASSES, lower=True, space="_")
|
validate_device_class = cv.one_of(*DEVICE_CLASSES, lower=True, space="_")
|
||||||
|
|
||||||
EVENT_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMPONENT_SCHEMA).extend(
|
EVENT_SCHEMA = (
|
||||||
|
cv.ENTITY_BASE_SCHEMA.extend(web_server.WEBSERVER_SORTING_SCHEMA)
|
||||||
|
.extend(cv.MQTT_COMPONENT_SCHEMA)
|
||||||
|
.extend(
|
||||||
{
|
{
|
||||||
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(mqtt.MQTTEventComponent),
|
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(mqtt.MQTTEventComponent),
|
||||||
cv.GenerateID(): cv.declare_id(Event),
|
cv.GenerateID(): cv.declare_id(Event),
|
||||||
|
@ -52,6 +56,7 @@ EVENT_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMPONENT_SCHEMA).extend(
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
_UNDEF = object()
|
_UNDEF = object()
|
||||||
|
|
||||||
|
@ -97,6 +102,9 @@ async def setup_event_core_(var, config, *, event_types: list[str]):
|
||||||
mqtt_ = cg.new_Pvariable(mqtt_id, var)
|
mqtt_ = cg.new_Pvariable(mqtt_id, var)
|
||||||
await mqtt.register_mqtt_component(mqtt_, config)
|
await mqtt.register_mqtt_component(mqtt_, config)
|
||||||
|
|
||||||
|
if web_server_config := config.get(CONF_WEB_SERVER):
|
||||||
|
await web_server.add_entity_config(var, web_server_config)
|
||||||
|
|
||||||
|
|
||||||
async def register_event(var, config, *, event_types: list[str]):
|
async def register_event(var, config, *, event_types: list[str]):
|
||||||
if not CORE.has_id(config[CONF_ID]):
|
if not CORE.has_id(config[CONF_ID]):
|
||||||
|
|
|
@ -64,47 +64,47 @@ uint16_t shelly_dimmer_checksum(const uint8_t *buf, int len) {
|
||||||
return std::accumulate<decltype(buf), uint16_t>(buf, buf + len, 0);
|
return std::accumulate<decltype(buf), uint16_t>(buf, buf + len, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShellyDimmer::setup() {
|
bool ShellyDimmer::is_running_configured_version() const {
|
||||||
this->pin_nrst_->setup();
|
return this->version_major_ == USE_SHD_FIRMWARE_MAJOR_VERSION &&
|
||||||
this->pin_boot0_->setup();
|
this->version_minor_ == USE_SHD_FIRMWARE_MINOR_VERSION;
|
||||||
|
}
|
||||||
ESP_LOGI(TAG, "Initializing Shelly Dimmer...");
|
|
||||||
|
|
||||||
|
void ShellyDimmer::handle_firmware() {
|
||||||
// Reset the STM32 and check the firmware version.
|
// Reset the STM32 and check the firmware version.
|
||||||
for (int i = 0; i < 2; i++) {
|
|
||||||
this->reset_normal_boot_();
|
this->reset_normal_boot_();
|
||||||
this->send_command_(SHELLY_DIMMER_PROTO_CMD_VERSION, nullptr, 0);
|
this->send_command_(SHELLY_DIMMER_PROTO_CMD_VERSION, nullptr, 0);
|
||||||
ESP_LOGI(TAG, "STM32 current firmware version: %d.%d, desired version: %d.%d", this->version_major_,
|
ESP_LOGI(TAG, "STM32 current firmware version: %d.%d, desired version: %d.%d", this->version_major_,
|
||||||
this->version_minor_, USE_SHD_FIRMWARE_MAJOR_VERSION, USE_SHD_FIRMWARE_MINOR_VERSION);
|
this->version_minor_, USE_SHD_FIRMWARE_MAJOR_VERSION, USE_SHD_FIRMWARE_MINOR_VERSION);
|
||||||
if (this->version_major_ != USE_SHD_FIRMWARE_MAJOR_VERSION ||
|
|
||||||
this->version_minor_ != USE_SHD_FIRMWARE_MINOR_VERSION) {
|
|
||||||
#ifdef USE_SHD_FIRMWARE_DATA
|
|
||||||
// Update firmware if needed.
|
|
||||||
ESP_LOGW(TAG, "Unsupported STM32 firmware version, flashing");
|
|
||||||
if (i > 0) {
|
|
||||||
// Upgrade was already performed but the reported version is still not right.
|
|
||||||
ESP_LOGE(TAG, "STM32 firmware upgrade already performed, but version is still incorrect");
|
|
||||||
this->mark_failed();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!is_running_configured_version()) {
|
||||||
|
#ifdef USE_SHD_FIRMWARE_DATA
|
||||||
if (!this->upgrade_firmware_()) {
|
if (!this->upgrade_firmware_()) {
|
||||||
ESP_LOGW(TAG, "Failed to upgrade firmware");
|
ESP_LOGW(TAG, "Failed to upgrade firmware");
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Firmware upgrade completed, do the checks again.
|
this->reset_normal_boot_();
|
||||||
continue;
|
this->send_command_(SHELLY_DIMMER_PROTO_CMD_VERSION, nullptr, 0);
|
||||||
#else
|
if (!is_running_configured_version()) {
|
||||||
ESP_LOGW(TAG, "Firmware version mismatch, put 'update: true' in the yaml to flash an update.");
|
ESP_LOGE(TAG, "STM32 firmware upgrade already performed, but version is still incorrect");
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
ESP_LOGW(TAG, "Firmware version mismatch, put 'update: true' in the yaml to flash an update.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShellyDimmer::setup() {
|
||||||
|
this->pin_nrst_->setup();
|
||||||
|
this->pin_boot0_->setup();
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "Initializing Shelly Dimmer...");
|
||||||
|
|
||||||
|
this->handle_firmware();
|
||||||
|
|
||||||
this->send_settings_();
|
this->send_settings_();
|
||||||
// Do an immediate poll to refresh current state.
|
// Do an immediate poll to refresh current state.
|
||||||
this->send_command_(SHELLY_DIMMER_PROTO_CMD_POLL, nullptr, 0);
|
this->send_command_(SHELLY_DIMMER_PROTO_CMD_POLL, nullptr, 0);
|
||||||
|
|
|
@ -20,6 +20,8 @@ class ShellyDimmer : public PollingComponent, public light::LightOutput, public
|
||||||
public:
|
public:
|
||||||
float get_setup_priority() const override { return setup_priority::LATE; }
|
float get_setup_priority() const override { return setup_priority::LATE; }
|
||||||
|
|
||||||
|
bool is_running_configured_version() const;
|
||||||
|
void handle_firmware();
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void update() override;
|
void update() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
|
@ -18,8 +18,8 @@ void Touchscreen::attach_interrupt_(InternalGPIOPin *irq_pin, esphome::gpio::Int
|
||||||
|
|
||||||
void Touchscreen::call_setup() {
|
void Touchscreen::call_setup() {
|
||||||
if (this->display_ != nullptr) {
|
if (this->display_ != nullptr) {
|
||||||
this->display_width_ = this->display_->get_native_width();
|
this->display_width_ = this->display_->get_width();
|
||||||
this->display_height_ = this->display_->get_native_height();
|
this->display_height_ = this->display_->get_height();
|
||||||
}
|
}
|
||||||
PollingComponent::call_setup();
|
PollingComponent::call_setup();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1443,7 +1443,7 @@ void WebServer::on_event(event::Event *obj, const std::string &event_type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string WebServer::event_json(event::Event *obj, const std::string &event_type, JsonDetail start_config) {
|
std::string WebServer::event_json(event::Event *obj, const std::string &event_type, JsonDetail start_config) {
|
||||||
return json::build_json([obj, event_type, start_config](JsonObject root) {
|
return json::build_json([this, obj, event_type, start_config](JsonObject root) {
|
||||||
set_json_id(root, obj, "event-" + obj->get_object_id(), start_config);
|
set_json_id(root, obj, "event-" + obj->get_object_id(), start_config);
|
||||||
if (!event_type.empty()) {
|
if (!event_type.empty()) {
|
||||||
root["event_type"] = event_type;
|
root["event_type"] = event_type;
|
||||||
|
@ -1454,6 +1454,12 @@ std::string WebServer::event_json(event::Event *obj, const std::string &event_ty
|
||||||
event_types.add(event_type);
|
event_types.add(event_type);
|
||||||
}
|
}
|
||||||
root["device_class"] = obj->get_device_class();
|
root["device_class"] = obj->get_device_class();
|
||||||
|
if (this->sorting_entitys_.find(obj) != this->sorting_entitys_.end()) {
|
||||||
|
root["sorting_weight"] = this->sorting_entitys_[obj].weight;
|
||||||
|
if (this->sorting_groups_.find(this->sorting_entitys_[obj].group_id) != this->sorting_groups_.end()) {
|
||||||
|
root["sorting_group"] = this->sorting_groups_[this->sorting_entitys_[obj].group_id].name;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2024.10.0b1"
|
__version__ = "2024.10.0b2"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
|
Loading…
Add table
Reference in a new issue