Compare commits

...

19 Commits

Author SHA1 Message Date
Clyde Stubbs
faabafad2b [mipi_rgb] Fix offsets for Wave 5 1024x600 (#17057) 2026-06-22 09:54:05 +12:00
Jesse Hills
cce7cfff29 Mark configurable classes as final (3/21: ble_scanner-ch423) (#16954) 2026-06-22 09:52:32 +12:00
Kevin Ahrendt
77a91853be [i2s_audio] Narrow wider streams to the speaker's configured bit depth (#16821)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-06-22 09:52:05 +12:00
Jesse Hills
73dbc8214b Mark configurable classes as final (4/21: chsc6x-dfplayer) (#16955) 2026-06-22 09:51:31 +12:00
Jesse Hills
7d7cdb6c66 Mark configurable classes as final (21/21: zhlt01-zyaura) (#16972) 2026-06-22 09:51:11 +12:00
J. Nick Koston
0d7130c499 [docs] Remove leftover dashboard references after dashboard removal (#17125) 2026-06-22 09:48:21 +12:00
J. Nick Koston
1d5d581734 [esp8266] Drop stale esphome-docker-base reference (#17123) 2026-06-22 09:34:09 +12:00
Jesse Hills
d0e3e98d55 [dashboard] Remove legacy web dashboard (#17124) 2026-06-22 09:33:27 +12:00
J. Nick Koston
c4abc5476e [core] Remove deprecated std::string scheduler/timer overloads (#17111) 2026-06-21 16:22:08 -05:00
J. Nick Koston
6c10fc1272 [hub75] Remove deprecated scan_wiring name aliases (#17118) 2026-06-21 16:21:50 -05:00
Kevin Ahrendt
036768c399 [audio] Fix mono channel MP3 playback (#17106) 2026-06-21 15:19:13 -05:00
J. Nick Koston
921758f87d [core] Clarify resolve error when a device has no network log/OTA transport (#17107) 2026-06-21 15:00:55 -05:00
J. Nick Koston
c6ead57a9e [packages] Remove deprecated single-package include syntax (#17119) 2026-06-22 08:00:46 +12:00
J. Nick Koston
78c6131bbf [web_server] Deprecate version 1 (#17109) 2026-06-21 15:00:36 -05:00
J. Nick Koston
d8f883bd9d [core] Remove deprecated get_object_id() and get_compilation_time() (#17112) 2026-06-22 07:54:05 +12:00
J. Nick Koston
d1d77fc217 [remote_base] Remove deprecated MideaData::to_string() (#17117) 2026-06-22 07:51:08 +12:00
J. Nick Koston
f273221cf4 [core] Remove deprecated value_accuracy_to_string() (#17116) 2026-06-22 07:50:32 +12:00
J. Nick Koston
03121d2efe [core] Remove deprecated std::string GPIOPin::dump_summary() (#17115) 2026-06-22 07:49:27 +12:00
J. Nick Koston
7c2603d9bc [ethernet] Defer clk_mode removal to 2026.9.0 (#17114) 2026-06-22 07:47:15 +12:00
195 changed files with 610 additions and 8247 deletions

View File

@@ -41,7 +41,6 @@ function hasCoreChanges(changedFiles) {
*/
function hasDashboardChanges(changedFiles) {
return changedFiles.some(file =>
file.startsWith('esphome/dashboard/') ||
file.startsWith('esphome/components/dashboard_import/')
);
}

View File

@@ -1,119 +0,0 @@
name: Add Dashboard Deprecation Comment
on:
pull_request_target:
types: [opened, synchronize]
# All API calls (pulls.listFiles + issues.{list,create,update}Comment) are performed with
# the App token minted below, so the workflow's GITHUB_TOKEN does not need any scopes.
permissions: {}
jobs:
dashboard-deprecation-comment:
name: Dashboard deprecation comment
runs-on: ubuntu-latest
# Release-bump PRs (bump-X.Y.Z -> beta, beta -> release) inevitably
# roll up everything merged into dev since the last cut, which can
# include dashboard changes that have already been reviewed once.
# The bot's purpose is to warn new contributors before they invest
# time -- that only applies to PRs entering dev.
if: github.event.pull_request.base.ref == 'dev'
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.ESPHOME_GITHUB_APP_CLIENT_ID }}
private-key: ${{ secrets.ESPHOME_GITHUB_APP_PRIVATE_KEY }}
# pulls.listFiles + issues.{list,create,update}Comment on PRs. For PR resources
# the issues.*Comment APIs require the pull-requests scope, not issues.
permission-pull-requests: write
- name: Add dashboard deprecation comment
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const commentMarker = "<!-- This comment was generated automatically by the dashboard-deprecation-comment workflow. -->";
const commentBody = `Thanks for opening this PR!
Heads up: the legacy ESPHome dashboard (\`esphome/dashboard/\` and \`tests/dashboard/\`) is **deprecated** and is being replaced by [ESPHome Device Builder](https://github.com/esphome/device-builder). We are not adding new features to the legacy dashboard and it will eventually be removed from this repository.
What this means for your PR:
- **New features / enhancements**: please port the change to [esphome/device-builder](https://github.com/esphome/device-builder) instead. We are unlikely to review or merge new dashboard features here.
- **Bug fixes**: small fixes may still be considered, but please check first whether the same issue exists in Device Builder, where the fix will have a longer life.
- **Security issues**: please do not file a public PR. Report privately via [GitHub security advisories](https://github.com/esphome/esphome/security/advisories/new) so we can coordinate a fix.
We appreciate the contribution and apologize for the friction; flagging this early so your time isn't spent on a change that may not land.
---
(Added by the PR bot)
${commentMarker}`;
async function getDashboardChanges(github, owner, repo, prNumber) {
const changedFiles = await github.paginate(
github.rest.pulls.listFiles,
{
owner: owner,
repo: repo,
pull_number: prNumber,
per_page: 100,
}
);
return changedFiles.filter(file =>
file.filename.startsWith('esphome/dashboard/') ||
file.filename.startsWith('tests/dashboard/')
);
}
async function findBotComment(github, owner, repo, prNumber) {
const comments = await github.paginate(
github.rest.issues.listComments,
{
owner: owner,
repo: repo,
issue_number: prNumber,
per_page: 100,
}
);
return comments.find(comment =>
comment.body.includes(commentMarker) && comment.user.type === "Bot"
);
}
const prNumber = context.payload.pull_request.number;
const { owner, repo } = context.repo;
const dashboardChanges = await getDashboardChanges(github, owner, repo, prNumber);
const existingComment = await findBotComment(github, owner, repo, prNumber);
if (dashboardChanges.length === 0) {
// PR doesn't (or no longer) touches the legacy dashboard. If we previously
// commented (e.g. files were removed in a later push), leave the comment in
// place for history rather than thrash on edit/delete.
return;
}
if (existingComment) {
if (existingComment.body === commentBody) {
return;
}
await github.rest.issues.updateComment({
owner: owner,
repo: repo,
comment_id: existingComment.id,
body: commentBody,
});
} else {
await github.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: prNumber,
body: commentBody,
});
}

View File

@@ -14,7 +14,7 @@ This document provides essential context for AI models interacting with this pro
* **Build Systems:** PlatformIO is the primary build system. CMake is used as an alternative.
* **Configuration:** YAML.
* **Key Libraries/Dependencies:**
* **Python:** `voluptuous` (for configuration validation), `PyYAML` (for parsing configuration files), `paho-mqtt` (for MQTT communication), `tornado` (for the web server), `aioesphomeapi` (for the native API).
* **Python:** `voluptuous` (for configuration validation), `PyYAML` (for parsing configuration files), `paho-mqtt` (for MQTT communication), `aioesphomeapi` (for the native API).
* **C++:** `ArduinoJson` (for JSON serialization/deserialization), `AsyncMqttClient-esphome` (for MQTT), `ESPAsyncWebServer` (for the web server).
* **Package Manager(s):** `pip` (for Python dependencies), `platformio` (for C++/PlatformIO dependencies).
* **Communication Protocols:** Protobuf (for native API), MQTT, HTTP.
@@ -35,7 +35,6 @@ This document provides essential context for AI models interacting with this pro
2. **Code Generation** (`esphome/codegen.py`, `esphome/cpp_generator.py`): Manages Python to C++ code generation, template processing, and build flag management.
3. **Component System** (`esphome/components/`): Contains modular hardware and software components with platform-specific implementations and dependency management.
4. **Core Framework** (`esphome/core/`): Manages the application lifecycle, hardware abstraction, and component registration.
5. **Dashboard** (`esphome/dashboard/`): A web-based interface for device configuration, management, and OTA updates.
* **Platform Support:**
1. **ESP32** (`components/esp32/`): Espressif ESP32 family. Supports multiple variants (Original, C2, C3, C5, C6, H2, P4, S2, S3) with ESP-IDF framework. Arduino framework supports only a subset of the variants (Original, C3, S2, S3).
@@ -456,7 +455,6 @@ This document provides essential context for AI models interacting with this pro
* **Debug Tools:**
- `esphome config <file>.yaml` to validate configuration.
- `esphome compile <file>.yaml` to compile without uploading.
- Check the Dashboard for real-time logs.
- Use component-specific debug logging.
* **Common Issues:**
- **Import Errors**: Check component dependencies and `PYTHONPATH`.
@@ -658,7 +656,7 @@ This document provides essential context for AI models interacting with this pro
If you need a real-world example, search for components that use `@dataclass` with `CORE.data` in the codebase. Note: Some components may use `TypedDict` for dictionary-based storage; both patterns are acceptable depending on your needs.
**Why this matters:**
- Module-level globals persist between compilation runs if the dashboard doesn't fork/exec
- Module-level globals persist between compilation runs if the host process (e.g. device-builder) doesn't fork/exec
- `CORE.data` automatically clears between runs
- Namespacing under `DOMAIN` prevents key collisions between components
- `@dataclass` provides type safety and cleaner attribute access

View File

@@ -88,8 +88,6 @@ These *are* security bugs in this repo, and we want to hear about them privately
holds the API key / OTA / web credentials).
- Anything in the dashboard / device-builder — report that in its own repository
(linked at the top).
- The legacy bundled dashboard in this repo (`esphome/dashboard/`) — it is
deprecated and being replaced by Device Builder; report dashboard issues there.
- Deployments where the operator removed protections or exposed credentials. See
the security best practices guide:
https://esphome.io/guides/security_best_practices/

View File

@@ -268,6 +268,36 @@ def _ota_hostnames_for_default(purpose: Purpose) -> list[str]:
return _resolve_with_cache(CORE.address, purpose)
def _unresolved_default_error(purpose: Purpose, defaults: list[str]) -> str:
"""Build the error when a default device target produced no usable host.
When the OTA default was requested and the address resolves but the config
lacks the transport the purpose needs (``api:`` for logs, an ``ota:``
platform for uploads), name that gap instead of the misleading
"could not be resolved" / set-use_address hint.
"""
if "OTA" in defaults and has_resolvable_address():
if purpose == Purpose.LOGGING and not has_api():
return (
"Cannot view logs over the network: no 'api:' component is "
"configured. Network log streaming requires the native API; add "
"an 'api:' component, enable MQTT logging, or view logs over USB."
)
if purpose == Purpose.UPLOADING and not has_ota():
return (
"Cannot upload over the network: no 'ota:' platform is "
"configured. Add an 'ota:' platform, or upload over USB."
)
if CORE.dashboard:
hint = "If you know the IP, set 'use_address' in your network config."
else:
hint = "If you know the IP, try --device <IP>"
return (
f"All specified devices {defaults} could not be resolved. "
f"Is the device connected to the network? {hint}"
)
def choose_upload_log_host(
default: list[str] | str | None,
check_default: str | None,
@@ -317,14 +347,7 @@ def choose_upload_log_host(
else:
resolved.append(device)
if not resolved:
if CORE.dashboard:
hint = "If you know the IP, set 'use_address' in your network config."
else:
hint = "If you know the IP, try --device <IP>"
raise EsphomeError(
f"All specified devices {defaults} could not be resolved. "
f"Is the device connected to the network? {hint}"
)
raise EsphomeError(_unresolved_default_error(purpose, defaults))
return resolved
# No devices specified, show interactive chooser
@@ -504,7 +527,7 @@ def has_resolvable_address() -> bool:
if has_ip_address():
return True
# The dashboard pre-resolves the device and passes the IPs via
# device-builder pre-resolves the device and passes the IPs via
# --mdns-address-cache/--dns-address-cache; honor a cached address even when the
# device has mDNS disabled (e.g. a .local host found via ping).
if CORE.address_cache and CORE.address_cache.get_addresses(CORE.address):
@@ -1692,9 +1715,13 @@ def command_bundle(args: ArgsProtocol, config: ConfigType) -> int | None:
def command_dashboard(args: ArgsProtocol) -> int | None:
from esphome.dashboard import dashboard
return dashboard.start_dashboard(args)
raise EsphomeError(
"The built-in dashboard has been removed from ESPHome. "
"Install and run ESPHome Device Builder instead:\n"
" pip install esphome-device-builder\n"
" esphome-device-builder\n"
"See https://github.com/esphome/device-builder for more information."
)
def run_multiple_configs(
@@ -2356,44 +2383,22 @@ def parse_args(argv):
"configuration", help="Your YAML file or configuration directory.", nargs="*"
)
parser_dashboard = subparsers.add_parser(
"dashboard", help="Create a simple web server for a dashboard."
# The dashboard moved to ESPHome Device Builder; the command is kept only to
# print a redirect (see command_dashboard). Accept and ignore the old flags
# so legacy invocations reach that message instead of failing on argparse
# "unrecognized arguments".
parser_dashboard = subparsers.add_parser("dashboard")
parser_dashboard.add_argument("configuration", nargs="?", help=argparse.SUPPRESS)
parser_dashboard.add_argument("--port", help=argparse.SUPPRESS)
parser_dashboard.add_argument("--address", help=argparse.SUPPRESS)
parser_dashboard.add_argument("--username", help=argparse.SUPPRESS)
parser_dashboard.add_argument("--password", help=argparse.SUPPRESS)
parser_dashboard.add_argument("--socket", help=argparse.SUPPRESS)
parser_dashboard.add_argument(
"--open-ui", action="store_true", help=argparse.SUPPRESS
)
parser_dashboard.add_argument(
"configuration", help="Your YAML configuration file directory."
)
parser_dashboard.add_argument(
"--port",
help="The HTTP port to open connections on. Defaults to 6052.",
type=int,
default=6052,
)
parser_dashboard.add_argument(
"--address",
help="The address to bind to.",
type=str,
default="0.0.0.0",
)
parser_dashboard.add_argument(
"--username",
help="The optional username to require for authentication.",
type=str,
default="",
)
parser_dashboard.add_argument(
"--password",
help="The optional password to require for authentication.",
type=str,
default="",
)
parser_dashboard.add_argument(
"--open-ui", help="Open the dashboard UI in a browser.", action="store_true"
)
parser_dashboard.add_argument(
"--ha-addon", help=argparse.SUPPRESS, action="store_true"
)
parser_dashboard.add_argument(
"--socket", help="Make the dashboard serve under a unix socket", type=str
"--ha-addon", action="store_true", help=argparse.SUPPRESS
)
parser_vscode = subparsers.add_parser("vscode")
@@ -2488,11 +2493,7 @@ def run_esphome(argv):
elif args.quiet:
args.log_level = "CRITICAL"
setup_log(
log_level=args.log_level,
# Show timestamp for dashboard access logs
include_timestamp=args.command == "dashboard",
)
setup_log(log_level=args.log_level)
if args.command in PRE_CONFIG_ACTIONS:
try:

View File

@@ -326,14 +326,8 @@ FileDecoderState AudioDecoder::decode_mp3_() {
} else if (result == micro_mp3::MP3_NEED_MORE_DATA) {
return FileDecoderState::MORE_TO_PROCESS;
} else if (result == micro_mp3::MP3_OUTPUT_BUFFER_TOO_SMALL) {
// Reallocate to decode the frame on the next call
if (this->mp3_decoder_->get_channels() > 0) {
this->free_buffer_required_ =
this->mp3_decoder_->get_samples_per_frame() * this->mp3_decoder_->get_channels() * sizeof(int16_t);
} else {
// Fallback to worst-case size if channel info isn't available
this->free_buffer_required_ = this->mp3_decoder_->get_min_output_buffer_bytes();
}
// Fallback to worst-case size
this->free_buffer_required_ = this->mp3_decoder_->get_min_output_buffer_bytes();
if (!this->output_transfer_buffer_->reallocate(this->free_buffer_required_)) {
return FileDecoderState::FAILED;
}

View File

@@ -8,7 +8,7 @@
namespace esphome::b_parasite {
class BParasite : public Component, public esp32_ble_tracker::ESPBTDeviceListener {
class BParasite final : public Component, public esp32_ble_tracker::ESPBTDeviceListener {
public:
void set_address(uint64_t address) { address_ = address; };
void set_bindkey(const std::string &bindkey);

View File

@@ -12,7 +12,9 @@
namespace esphome::ble_scanner {
class BLEScanner : public text_sensor::TextSensor, public esp32_ble_tracker::ESPBTDeviceListener, public Component {
class BLEScanner final : public text_sensor::TextSensor,
public esp32_ble_tracker::ESPBTDeviceListener,
public Component {
public:
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override {
char addr_buf[MAC_ADDRESS_PRETTY_BUFFER_SIZE];

View File

@@ -5,7 +5,7 @@
namespace esphome::bm8563 {
class BM8563 : public time::RealTimeClock, public i2c::I2CDevice {
class BM8563 final : public time::RealTimeClock, public i2c::I2CDevice {
public:
void setup() override;
void update() override;
@@ -34,17 +34,17 @@ class BM8563 : public time::RealTimeClock, public i2c::I2CDevice {
uint8_t byte_to_bcd2_(uint8_t value);
};
template<typename... Ts> class WriteAction : public Action<Ts...>, public Parented<BM8563> {
template<typename... Ts> class WriteAction final : public Action<Ts...>, public Parented<BM8563> {
public:
void play(const Ts &...x) override { this->parent_->write_time(); }
};
template<typename... Ts> class ReadAction : public Action<Ts...>, public Parented<BM8563> {
template<typename... Ts> class ReadAction final : public Action<Ts...>, public Parented<BM8563> {
public:
void play(const Ts &...x) override { this->parent_->read_time(); }
};
template<typename... Ts> class TimerAction : public Action<Ts...>, public Parented<BM8563> {
template<typename... Ts> class TimerAction final : public Action<Ts...>, public Parented<BM8563> {
public:
TEMPLATABLE_VALUE(uint32_t, duration)

View File

@@ -7,7 +7,7 @@ namespace esphome::bme280_i2c {
static const char *const TAG = "bme280_i2c.sensor";
class BME280I2CComponent : public esphome::bme280_base::BME280Component, public i2c::I2CDevice {
class BME280I2CComponent final : public esphome::bme280_base::BME280Component, public i2c::I2CDevice {
bool read_byte(uint8_t a_register, uint8_t *data) override;
bool write_byte(uint8_t a_register, uint8_t data) override;
bool read_bytes(uint8_t a_register, uint8_t *data, size_t len) override;

View File

@@ -5,9 +5,9 @@
namespace esphome::bme280_spi {
class BME280SPIComponent : public esphome::bme280_base::BME280Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_200KHZ> {
class BME280SPIComponent final : public esphome::bme280_base::BME280Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_200KHZ> {
void setup() override;
bool read_byte(uint8_t a_register, uint8_t *data) override;
bool write_byte(uint8_t a_register, uint8_t data) override;

View File

@@ -65,7 +65,7 @@ struct BME680CalibrationData {
int8_t ambient_temperature;
};
class BME680Component : public PollingComponent, public i2c::I2CDevice {
class BME680Component final : public PollingComponent, public i2c::I2CDevice {
public:
/// Set the temperature oversampling value. Defaults to 16X.
void set_temperature_oversampling(BME680Oversampling temperature_oversampling);

View File

@@ -34,7 +34,7 @@ enum SampleRate {
#define BME680_BSEC_SAMPLE_RATE_LOG(r) (r == SAMPLE_RATE_DEFAULT ? "Default" : (r == SAMPLE_RATE_ULP ? "ULP" : "LP"))
class BME680BSECComponent : public Component, public i2c::I2CDevice {
class BME680BSECComponent final : public Component, public i2c::I2CDevice {
public:
void set_device_id(const std::string &devid) { this->device_id_.assign(devid); }
void set_temperature_offset(float offset) { this->temperature_offset_ = offset; }

View File

@@ -11,7 +11,7 @@
namespace esphome::bme68x_bsec2_i2c {
class BME68xBSEC2I2CComponent : public bme68x_bsec2::BME68xBSEC2Component, public i2c::I2CDevice {
class BME68xBSEC2I2CComponent final : public bme68x_bsec2::BME68xBSEC2Component, public i2c::I2CDevice {
void setup() override;
void dump_config() override;

View File

@@ -6,7 +6,7 @@
namespace esphome::bmi160 {
class BMI160Component : public PollingComponent, public i2c::I2CDevice {
class BMI160Component final : public PollingComponent, public i2c::I2CDevice {
public:
void setup() override;
void dump_config() override;

View File

@@ -78,7 +78,7 @@ enum BMI270GyroODR : uint8_t {
// ---Data class
// Main component class
class BMI270Component : public motion::MotionComponent, public i2c::I2CDevice {
class BMI270Component final : public motion::MotionComponent, public i2c::I2CDevice {
public:
// Lifecycle
void setup() override;

View File

@@ -6,7 +6,7 @@
namespace esphome::bmp085 {
class BMP085Component : public PollingComponent, public i2c::I2CDevice {
class BMP085Component final : public PollingComponent, public i2c::I2CDevice {
public:
void set_temperature(sensor::Sensor *temperature) { temperature_ = temperature; }
void set_pressure(sensor::Sensor *pressure) { pressure_ = pressure; }

View File

@@ -8,7 +8,7 @@ namespace esphome::bmp280_i2c {
static const char *const TAG = "bmp280_i2c.sensor";
/// This class implements support for the BMP280 Temperature+Pressure i2c sensor.
class BMP280I2CComponent : public esphome::bmp280_base::BMP280Component, public i2c::I2CDevice {
class BMP280I2CComponent final : public esphome::bmp280_base::BMP280Component, public i2c::I2CDevice {
public:
bool bmp_read_byte(uint8_t a_register, uint8_t *data) override { return read_byte(a_register, data); }
bool bmp_write_byte(uint8_t a_register, uint8_t data) override { return write_byte(a_register, data); }

View File

@@ -5,9 +5,9 @@
namespace esphome::bmp280_spi {
class BMP280SPIComponent : public esphome::bmp280_base::BMP280Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_200KHZ> {
class BMP280SPIComponent final : public esphome::bmp280_base::BMP280Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_200KHZ> {
void setup() override;
bool bmp_read_byte(uint8_t a_register, uint8_t *data) override;
bool bmp_write_byte(uint8_t a_register, uint8_t data) override;

View File

@@ -4,7 +4,7 @@
namespace esphome::bmp3xx_i2c {
class BMP3XXI2CComponent : public bmp3xx_base::BMP3XXComponent, public i2c::I2CDevice {
class BMP3XXI2CComponent final : public bmp3xx_base::BMP3XXComponent, public i2c::I2CDevice {
bool read_byte(uint8_t a_register, uint8_t *data) override;
bool write_byte(uint8_t a_register, uint8_t data) override;
bool read_bytes(uint8_t a_register, uint8_t *data, size_t len) override;

View File

@@ -4,9 +4,9 @@
namespace esphome::bmp3xx_spi {
class BMP3XXSPIComponent : public bmp3xx_base::BMP3XXComponent,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_1MHZ> {
class BMP3XXSPIComponent final : public bmp3xx_base::BMP3XXComponent,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_1MHZ> {
void setup() override;
bool read_byte(uint8_t a_register, uint8_t *data) override;
bool write_byte(uint8_t a_register, uint8_t data) override;

View File

@@ -8,7 +8,7 @@ namespace esphome::bmp581_i2c {
static const char *const TAG = "bmp581_i2c.sensor";
/// This class implements support for the BMP581 Temperature+Pressure i2c sensor.
class BMP581I2CComponent : public esphome::bmp581_base::BMP581Component, public i2c::I2CDevice {
class BMP581I2CComponent final : public esphome::bmp581_base::BMP581Component, public i2c::I2CDevice {
public:
bool bmp_read_byte(uint8_t a_register, uint8_t *data) override { return read_byte(a_register, data); }
bool bmp_write_byte(uint8_t a_register, uint8_t data) override { return write_byte(a_register, data); }

View File

@@ -6,9 +6,9 @@
namespace esphome::bmp581_spi {
// BMP581 is technically compatible with SPI Mode0 and Mode3. Default to Mode3.
class BMP581SPIComponent : public esphome::bmp581_base::BMP581Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH,
spi::CLOCK_PHASE_TRAILING, spi::DATA_RATE_200KHZ> {
class BMP581SPIComponent final : public esphome::bmp581_base::BMP581Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH,
spi::CLOCK_PHASE_TRAILING, spi::DATA_RATE_200KHZ> {
public:
void setup() override;
bool bmp_read_byte(uint8_t a_register, uint8_t *data) override;

View File

@@ -7,7 +7,7 @@
namespace esphome::bp1658cj {
class BP1658CJ : public Component {
class BP1658CJ final : public Component {
public:
class Channel;
@@ -29,7 +29,7 @@ class BP1658CJ : public Component {
/// Send new values if they were updated.
void loop() override;
class Channel : public output::FloatOutput {
class Channel final : public output::FloatOutput {
public:
void set_parent(BP1658CJ *parent) { parent_ = parent; }
void set_channel(uint8_t channel) { channel_ = channel; }

View File

@@ -7,7 +7,7 @@
namespace esphome::bp5758d {
class BP5758D : public Component {
class BP5758D final : public Component {
public:
class Channel;
@@ -23,7 +23,7 @@ class BP5758D : public Component {
/// Send new values if they were updated.
void loop() override;
class Channel : public output::FloatOutput {
class Channel final : public output::FloatOutput {
public:
void set_parent(BP5758D *parent) { parent_ = parent; }
void set_channel(uint8_t channel) { channel_ = channel; }

View File

@@ -12,7 +12,7 @@
namespace esphome::bthome_mithermometer {
class BTHomeMiThermometer : public esp32_ble_tracker::ESPBTDeviceListener, public Component {
class BTHomeMiThermometer final : public esp32_ble_tracker::ESPBTDeviceListener, public Component {
public:
void set_address(uint64_t address) { this->address_ = address; }
void set_bindkey(std::initializer_list<uint8_t> bindkey);

View File

@@ -6,7 +6,7 @@
namespace esphome::button {
template<typename... Ts> class PressAction : public Action<Ts...> {
template<typename... Ts> class PressAction final : public Action<Ts...> {
public:
explicit PressAction(Button *button) : button_(button) {}
@@ -16,7 +16,7 @@ template<typename... Ts> class PressAction : public Action<Ts...> {
Button *button_;
};
class ButtonPressTrigger : public Trigger<> {
class ButtonPressTrigger final : public Trigger<> {
public:
ButtonPressTrigger(Button *button) {
button->add_on_press_callback([this]() { this->trigger(); });

View File

@@ -5,7 +5,7 @@
namespace esphome::camera_encoder {
class EncoderBufferImpl : public camera::EncoderBuffer {
class EncoderBufferImpl final : public camera::EncoderBuffer {
public:
// --- EncoderBuffer ---
bool set_buffer_size(size_t size) override;

View File

@@ -11,7 +11,7 @@
namespace esphome::camera_encoder {
/// Encoder that uses the software-based JPEG implementation from Espressif's esp32-camera component.
class ESP32CameraJPEGEncoder : public camera::Encoder {
class ESP32CameraJPEGEncoder final : public camera::Encoder {
public:
/// Constructs a ESP32CameraJPEGEncoder instance.
/// @param quality Sets the quality of the encoded image (1-100).

View File

@@ -106,7 +106,7 @@ class Canbus : public Component {
virtual Error read_message(struct CanFrame *frame) = 0;
};
template<typename... Ts> class CanbusSendAction : public Action<Ts...>, public Parented<Canbus> {
template<typename... Ts> class CanbusSendAction final : public Action<Ts...>, public Parented<Canbus> {
public:
void set_data_template(std::vector<uint8_t> (*func)(Ts...)) {
// Stateless lambdas (generated by ESPHome) implicitly convert to function pointers
@@ -154,7 +154,7 @@ template<typename... Ts> class CanbusSendAction : public Action<Ts...>, public P
} data_;
};
class CanbusTrigger : public Trigger<std::vector<uint8_t>, uint32_t, bool>, public Component {
class CanbusTrigger final : public Trigger<std::vector<uint8_t>, uint32_t, bool>, public Component {
friend class Canbus;
public:

View File

@@ -26,7 +26,7 @@ enum {
CAP1188_SENSITVITY = 0x1f,
};
class CAP1188Channel : public binary_sensor::BinarySensor {
class CAP1188Channel final : public binary_sensor::BinarySensor {
public:
void set_channel(uint8_t channel) { channel_ = channel; }
void process(uint8_t data) { this->publish_state(static_cast<bool>(data & (1 << this->channel_))); }
@@ -35,7 +35,7 @@ class CAP1188Channel : public binary_sensor::BinarySensor {
uint8_t channel_{0};
};
class CAP1188Component : public Component, public i2c::I2CDevice {
class CAP1188Component final : public Component, public i2c::I2CDevice {
public:
void register_channel(CAP1188Channel *channel) { this->channels_.push_back(channel); }
void set_touch_threshold(uint8_t touch_threshold) { this->touch_threshold_ = touch_threshold; };

View File

@@ -14,7 +14,7 @@
namespace esphome::captive_portal {
class CaptivePortal : public AsyncWebHandler, public Component {
class CaptivePortal final : public AsyncWebHandler, public Component {
public:
CaptivePortal(web_server_base::WebServerBase *base);
void setup() override;

View File

@@ -16,9 +16,9 @@ class CC1101Listener {
virtual void on_packet(const std::vector<uint8_t> &packet, float freq_offset, float rssi, uint8_t lqi) = 0;
};
class CC1101Component : public Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_1MHZ> {
class CC1101Component final : public Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_1MHZ> {
public:
CC1101Component();
@@ -119,27 +119,27 @@ class CC1101Component : public Component,
};
// Action Wrappers
template<typename... Ts> class BeginTxAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class BeginTxAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
void play(const Ts &...x) override { this->parent_->begin_tx(); }
};
template<typename... Ts> class BeginRxAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class BeginRxAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
void play(const Ts &...x) override { this->parent_->begin_rx(); }
};
template<typename... Ts> class ResetAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class ResetAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
void play(const Ts &...x) override { this->parent_->reset(); }
};
template<typename... Ts> class SetIdleAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetIdleAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
void play(const Ts &...x) override { this->parent_->set_idle(); }
};
template<typename... Ts> class SendPacketAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SendPacketAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
void set_data_template(std::function<std::vector<uint8_t>(Ts...)> func) { this->data_func_ = func; }
void set_data_static(const uint8_t *data, size_t len) {
@@ -163,79 +163,80 @@ template<typename... Ts> class SendPacketAction : public Action<Ts...>, public P
size_t data_static_len_{0};
};
template<typename... Ts> class SetSymbolRateAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetSymbolRateAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(float, symbol_rate)
void play(const Ts &...x) override { this->parent_->set_symbol_rate(this->symbol_rate_.value(x...)); }
};
template<typename... Ts> class SetFrequencyAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetFrequencyAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(float, frequency)
void play(const Ts &...x) override { this->parent_->set_frequency(this->frequency_.value(x...)); }
};
template<typename... Ts> class SetOutputPowerAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetOutputPowerAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(float, output_power)
void play(const Ts &...x) override { this->parent_->set_output_power(this->output_power_.value(x...)); }
};
template<typename... Ts> class SetModulationTypeAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetModulationTypeAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(Modulation, modulation_type)
void play(const Ts &...x) override { this->parent_->set_modulation_type(this->modulation_type_.value(x...)); }
};
template<typename... Ts> class SetRxAttenuationAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetRxAttenuationAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(RxAttenuation, rx_attenuation)
void play(const Ts &...x) override { this->parent_->set_rx_attenuation(this->rx_attenuation_.value(x...)); }
};
template<typename... Ts> class SetDcBlockingFilterAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts>
class SetDcBlockingFilterAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(bool, dc_blocking_filter)
void play(const Ts &...x) override { this->parent_->set_dc_blocking_filter(this->dc_blocking_filter_.value(x...)); }
};
template<typename... Ts> class SetManchesterAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetManchesterAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(bool, manchester)
void play(const Ts &...x) override { this->parent_->set_manchester(this->manchester_.value(x...)); }
};
template<typename... Ts> class SetFilterBandwidthAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetFilterBandwidthAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(float, filter_bandwidth)
void play(const Ts &...x) override { this->parent_->set_filter_bandwidth(this->filter_bandwidth_.value(x...)); }
};
template<typename... Ts> class SetFskDeviationAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetFskDeviationAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(float, fsk_deviation)
void play(const Ts &...x) override { this->parent_->set_fsk_deviation(this->fsk_deviation_.value(x...)); }
};
template<typename... Ts> class SetMskDeviationAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetMskDeviationAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(uint8_t, msk_deviation)
void play(const Ts &...x) override { this->parent_->set_msk_deviation(this->msk_deviation_.value(x...)); }
};
template<typename... Ts> class SetChannelAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetChannelAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(uint8_t, channel)
void play(const Ts &...x) override { this->parent_->set_channel(this->channel_.value(x...)); }
};
template<typename... Ts> class SetChannelSpacingAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetChannelSpacingAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(float, channel_spacing)
void play(const Ts &...x) override { this->parent_->set_channel_spacing(this->channel_spacing_.value(x...)); }
};
template<typename... Ts> class SetIfFrequencyAction : public Action<Ts...>, public Parented<CC1101Component> {
template<typename... Ts> class SetIfFrequencyAction final : public Action<Ts...>, public Parented<CC1101Component> {
public:
TEMPLATABLE_VALUE(float, if_frequency)
void play(const Ts &...x) override { this->parent_->set_if_frequency(this->if_frequency_.value(x...)); }

View File

@@ -8,7 +8,7 @@
namespace esphome::ccs811 {
class CCS811Component : public PollingComponent, public i2c::I2CDevice {
class CCS811Component final : public PollingComponent, public i2c::I2CDevice {
public:
void set_co2(sensor::Sensor *co2) { co2_ = co2; }
void set_tvoc(sensor::Sensor *tvoc) { tvoc_ = tvoc; }

View File

@@ -7,7 +7,7 @@
namespace esphome::cd74hc4067 {
class CD74HC4067Component : public Component {
class CD74HC4067Component final : public Component {
public:
/// Set up the internal sensor array.
void setup() override;
@@ -38,7 +38,7 @@ class CD74HC4067Component : public Component {
uint32_t switch_delay_;
};
class CD74HC4067Sensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
class CD74HC4067Sensor final : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
public:
CD74HC4067Sensor(CD74HC4067Component *parent);

View File

@@ -6,7 +6,7 @@
namespace esphome::ch422g {
class CH422GComponent : public Component, public i2c::I2CDevice {
class CH422GComponent final : public Component, public i2c::I2CDevice {
public:
CH422GComponent() = default;
@@ -42,7 +42,7 @@ class CH422GComponent : public Component, public i2c::I2CDevice {
};
/// Helper class to expose a CH422G pin as a GPIO pin.
class CH422GGPIOPin : public GPIOPin {
class CH422GGPIOPin final : public GPIOPin {
public:
void setup() override{};
void pin_mode(gpio::Flags flags) override;

View File

@@ -6,7 +6,7 @@
namespace esphome::ch423 {
class CH423Component : public Component, public i2c::I2CDevice {
class CH423Component final : public Component, public i2c::I2CDevice {
public:
CH423Component() = default;
@@ -41,7 +41,7 @@ class CH423Component : public Component, public i2c::I2CDevice {
};
/// Helper class to expose a CH423 pin as a GPIO pin.
class CH423GPIOPin : public GPIOPin {
class CH423GPIOPin final : public GPIOPin {
public:
void setup() override{};
void pin_mode(gpio::Flags flags) override;

View File

@@ -17,7 +17,7 @@ static const uint8_t CHSC6X_REG_STATUS_Y_COR = 0x04;
static const uint8_t CHSC6X_REG_STATUS_LEN = 0x05;
static const uint8_t CHSC6X_CHIP_ID = 0x2e;
class CHSC6XTouchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice {
class CHSC6XTouchscreen final : public touchscreen::Touchscreen, public i2c::I2CDevice {
public:
void setup() override;
void update_touches() override;

View File

@@ -17,7 +17,7 @@ namespace esphome::climate {
// (e.g. `const T & &` if Ts already carries a reference, or `const const
// T &` if Ts already carries a const). This keeps trigger args no-copy
// regardless of whether the trigger supplies `T`, `T &`, or `const T &`.
template<typename... Ts> class ControlAction : public Action<Ts...> {
template<typename... Ts> class ControlAction final : public Action<Ts...> {
public:
using ApplyFn = void (*)(ClimateCall &, const std::remove_cvref_t<Ts> &...);
ControlAction(Climate *climate, ApplyFn apply) : climate_(climate), apply_(apply) {}
@@ -33,14 +33,14 @@ template<typename... Ts> class ControlAction : public Action<Ts...> {
ApplyFn apply_;
};
class ControlTrigger : public Trigger<ClimateCall &> {
class ControlTrigger final : public Trigger<ClimateCall &> {
public:
ControlTrigger(Climate *climate) {
climate->add_on_control_callback([this](ClimateCall &x) { this->trigger(x); });
}
};
class StateTrigger : public Trigger<Climate &> {
class StateTrigger final : public Trigger<Climate &> {
public:
StateTrigger(Climate *climate) {
climate->add_on_state_callback([this](Climate &x) { this->trigger(x); });

View File

@@ -10,7 +10,7 @@ namespace esphome::climate_ir_lg {
const uint8_t TEMP_MIN = 18; // Celsius
const uint8_t TEMP_MAX = 30; // Celsius
class LgIrClimate : public climate_ir::ClimateIR {
class LgIrClimate final : public climate_ir::ClimateIR {
public:
LgIrClimate()
: climate_ir::ClimateIR(TEMP_MIN, TEMP_MAX, 1.0f, true, true,

View File

@@ -7,7 +7,7 @@
namespace esphome::cm1106 {
class CM1106Component : public PollingComponent, public uart::UARTDevice {
class CM1106Component final : public PollingComponent, public uart::UARTDevice {
public:
void setup() override;
void update() override;
@@ -23,7 +23,7 @@ class CM1106Component : public PollingComponent, public uart::UARTDevice {
bool cm1106_write_command_(const uint8_t *command, size_t command_len, uint8_t *response, size_t response_len);
};
template<typename... Ts> class CM1106CalibrateZeroAction : public Action<Ts...> {
template<typename... Ts> class CM1106CalibrateZeroAction final : public Action<Ts...> {
public:
CM1106CalibrateZeroAction(CM1106Component *cm1106) : cm1106_(cm1106) {}

View File

@@ -6,7 +6,7 @@
namespace esphome::color_temperature {
class CTLightOutput : public light::LightOutput {
class CTLightOutput final : public light::LightOutput {
public:
void set_color_temperature(output::FloatOutput *color_temperature) { color_temperature_ = color_temperature; }
void set_brightness(output::FloatOutput *brightness) { brightness_ = brightness; }

View File

@@ -58,7 +58,7 @@ class CombinationOneParameterComponent : public CombinationComponent {
FixedVector<SensorSource> sensor_sources_;
};
class KalmanCombinationComponent : public CombinationOneParameterComponent {
class KalmanCombinationComponent final : public CombinationOneParameterComponent {
public:
void dump_config() override;
void setup() override;
@@ -85,7 +85,7 @@ class KalmanCombinationComponent : public CombinationOneParameterComponent {
float variance_{INFINITY};
};
class LinearCombinationComponent : public CombinationOneParameterComponent {
class LinearCombinationComponent final : public CombinationOneParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("linear")); }
void setup() override;
@@ -93,49 +93,49 @@ class LinearCombinationComponent : public CombinationOneParameterComponent {
void handle_new_value(float value);
};
class MaximumCombinationComponent : public CombinationNoParameterComponent {
class MaximumCombinationComponent final : public CombinationNoParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("max")); }
void handle_new_value(float value) override;
};
class MeanCombinationComponent : public CombinationNoParameterComponent {
class MeanCombinationComponent final : public CombinationNoParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("mean")); }
void handle_new_value(float value) override;
};
class MedianCombinationComponent : public CombinationNoParameterComponent {
class MedianCombinationComponent final : public CombinationNoParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("median")); }
void handle_new_value(float value) override;
};
class MinimumCombinationComponent : public CombinationNoParameterComponent {
class MinimumCombinationComponent final : public CombinationNoParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("min")); }
void handle_new_value(float value) override;
};
class MostRecentCombinationComponent : public CombinationNoParameterComponent {
class MostRecentCombinationComponent final : public CombinationNoParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("most_recently_updated")); }
void handle_new_value(float value) override;
};
class RangeCombinationComponent : public CombinationNoParameterComponent {
class RangeCombinationComponent final : public CombinationNoParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("range")); }
void handle_new_value(float value) override;
};
class SumCombinationComponent : public CombinationNoParameterComponent {
class SumCombinationComponent final : public CombinationNoParameterComponent {
public:
void dump_config() override { this->log_config_(LOG_STR("sum")); }

View File

@@ -10,7 +10,7 @@ namespace esphome::coolix {
const uint8_t COOLIX_TEMP_MIN = 17; // Celsius
const uint8_t COOLIX_TEMP_MAX = 30; // Celsius
class CoolixClimate : public climate_ir::ClimateIR {
class CoolixClimate final : public climate_ir::ClimateIR {
public:
CoolixClimate()
: climate_ir::ClimateIR(COOLIX_TEMP_MIN, COOLIX_TEMP_MAX, 1.0f, true, true,

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyBinarySensor : public binary_sensor::BinarySensor, public Component {
class CopyBinarySensor final : public binary_sensor::BinarySensor, public Component {
public:
void set_source(binary_sensor::BinarySensor *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyButton : public button::Button, public Component {
class CopyButton final : public button::Button, public Component {
public:
void set_source(button::Button *source) { source_ = source; }
void dump_config() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyCover : public cover::Cover, public Component {
class CopyCover final : public cover::Cover, public Component {
public:
void set_source(cover::Cover *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyFan : public fan::Fan, public Component {
class CopyFan final : public fan::Fan, public Component {
public:
void set_source(fan::Fan *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyLock : public lock::Lock, public Component {
class CopyLock final : public lock::Lock, public Component {
public:
void set_source(lock::Lock *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyNumber : public number::Number, public Component {
class CopyNumber final : public number::Number, public Component {
public:
void set_source(number::Number *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopySelect : public select::Select, public Component {
class CopySelect final : public select::Select, public Component {
public:
void set_source(select::Select *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopySensor : public sensor::Sensor, public Component {
class CopySensor final : public sensor::Sensor, public Component {
public:
void set_source(sensor::Sensor *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopySwitch : public switch_::Switch, public Component {
class CopySwitch final : public switch_::Switch, public Component {
public:
void set_source(switch_::Switch *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyText : public text::Text, public Component {
class CopyText final : public text::Text, public Component {
public:
void set_source(text::Text *source) { source_ = source; }
void setup() override;

View File

@@ -5,7 +5,7 @@
namespace esphome::copy {
class CopyTextSensor : public text_sensor::TextSensor, public Component {
class CopyTextSensor final : public text_sensor::TextSensor, public Component {
public:
void set_source(text_sensor::TextSensor *source) { source_ = source; }
void setup() override;

View File

@@ -6,7 +6,7 @@
namespace esphome::cover {
template<typename... Ts> class OpenAction : public Action<Ts...> {
template<typename... Ts> class OpenAction final : public Action<Ts...> {
public:
explicit OpenAction(Cover *cover) : cover_(cover) {}
@@ -16,7 +16,7 @@ template<typename... Ts> class OpenAction : public Action<Ts...> {
Cover *cover_;
};
template<typename... Ts> class CloseAction : public Action<Ts...> {
template<typename... Ts> class CloseAction final : public Action<Ts...> {
public:
explicit CloseAction(Cover *cover) : cover_(cover) {}
@@ -26,7 +26,7 @@ template<typename... Ts> class CloseAction : public Action<Ts...> {
Cover *cover_;
};
template<typename... Ts> class StopAction : public Action<Ts...> {
template<typename... Ts> class StopAction final : public Action<Ts...> {
public:
explicit StopAction(Cover *cover) : cover_(cover) {}
@@ -36,7 +36,7 @@ template<typename... Ts> class StopAction : public Action<Ts...> {
Cover *cover_;
};
template<typename... Ts> class ToggleAction : public Action<Ts...> {
template<typename... Ts> class ToggleAction final : public Action<Ts...> {
public:
explicit ToggleAction(Cover *cover) : cover_(cover) {}
@@ -59,7 +59,7 @@ template<typename... Ts> class ToggleAction : public Action<Ts...> {
// T &` if Ts already carries a const). This keeps trigger args no-copy
// regardless of whether the trigger supplies `T`, `T &`, or `const T &`.
template<typename... Ts> class ControlAction : public Action<Ts...> {
template<typename... Ts> class ControlAction final : public Action<Ts...> {
public:
using ApplyFn = void (*)(CoverCall &, const std::remove_cvref_t<Ts> &...);
ControlAction(Cover *cover, ApplyFn apply) : cover_(cover), apply_(apply) {}
@@ -75,7 +75,7 @@ template<typename... Ts> class ControlAction : public Action<Ts...> {
ApplyFn apply_;
};
template<typename... Ts> class CoverPublishAction : public Action<Ts...> {
template<typename... Ts> class CoverPublishAction final : public Action<Ts...> {
public:
using ApplyFn = void (*)(Cover *, const std::remove_cvref_t<Ts> &...);
CoverPublishAction(Cover *cover, ApplyFn apply) : cover_(cover), apply_(apply) {}
@@ -90,7 +90,7 @@ template<typename... Ts> class CoverPublishAction : public Action<Ts...> {
ApplyFn apply_;
};
template<bool OPEN, typename... Ts> class CoverPositionCondition : public Condition<Ts...> {
template<bool OPEN, typename... Ts> class CoverPositionCondition final : public Condition<Ts...> {
public:
CoverPositionCondition(Cover *cover) : cover_(cover) {}
@@ -103,7 +103,7 @@ template<bool OPEN, typename... Ts> class CoverPositionCondition : public Condit
template<typename... Ts> using CoverIsOpenCondition = CoverPositionCondition<true, Ts...>;
template<typename... Ts> using CoverIsClosedCondition = CoverPositionCondition<false, Ts...>;
template<bool OPEN> class CoverPositionTrigger : public Trigger<> {
template<bool OPEN> class CoverPositionTrigger final : public Trigger<> {
public:
CoverPositionTrigger(Cover *a_cover) : cover_(a_cover) {
a_cover->add_on_state_callback([this]() {
@@ -123,7 +123,7 @@ template<bool OPEN> class CoverPositionTrigger : public Trigger<> {
using CoverOpenedTrigger = CoverPositionTrigger<true>;
using CoverClosedTrigger = CoverPositionTrigger<false>;
template<CoverOperation OP> class CoverTrigger : public Trigger<> {
template<CoverOperation OP> class CoverTrigger final : public Trigger<> {
public:
CoverTrigger(Cover *a_cover) : cover_(a_cover) {
a_cover->add_on_state_callback([this]() {

View File

@@ -52,9 +52,9 @@ enum CS5460APGAGain {
CS5460A_PGA_GAIN_50X = 0b1,
};
class CS5460AComponent : public Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_1MHZ> {
class CS5460AComponent final : public Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_1MHZ> {
public:
void set_samples(uint32_t samples) { samples_ = samples; }
void set_phase_offset(int8_t phase_offset) { phase_offset_ = phase_offset; }
@@ -108,7 +108,7 @@ class CS5460AComponent : public Component,
uint32_t prev_raw_energy_{0};
};
template<typename... Ts> class CS5460ARestartAction : public Action<Ts...> {
template<typename... Ts> class CS5460ARestartAction final : public Action<Ts...> {
public:
CS5460ARestartAction(CS5460AComponent *cs5460a) : cs5460a_(cs5460a) {}

View File

@@ -16,7 +16,7 @@ struct CSE7761DataStruct {
};
/// This class implements support for the CSE7761 UART power sensor.
class CSE7761Component : public PollingComponent, public uart::UARTDevice {
class CSE7761Component final : public PollingComponent, public uart::UARTDevice {
public:
void set_voltage_sensor(sensor::Sensor *voltage_sensor) { voltage_sensor_ = voltage_sensor; }
void set_active_power_1_sensor(sensor::Sensor *power_sensor_1) { power_sensor_1_ = power_sensor_1; }

View File

@@ -9,7 +9,7 @@ namespace esphome::cse7766 {
static constexpr size_t CSE7766_RAW_DATA_SIZE = 24;
class CSE7766Component : public Component, public uart::UARTDevice {
class CSE7766Component final : public Component, public uart::UARTDevice {
public:
void set_voltage_sensor(sensor::Sensor *voltage_sensor) { voltage_sensor_ = voltage_sensor; }
void set_current_sensor(sensor::Sensor *current_sensor) { current_sensor_ = current_sensor; }

View File

@@ -6,10 +6,10 @@
namespace esphome::cst226 {
class CST226Button : public binary_sensor::BinarySensor,
public Component,
public CST226ButtonListener,
public Parented<CST226Touchscreen> {
class CST226Button final : public binary_sensor::BinarySensor,
public Component,
public CST226ButtonListener,
public Parented<CST226Touchscreen> {
public:
void setup() override;
void dump_config() override;

View File

@@ -15,7 +15,7 @@ class CST226ButtonListener {
virtual void update_button(bool state) = 0;
};
class CST226Touchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice {
class CST226Touchscreen final : public touchscreen::Touchscreen, public i2c::I2CDevice {
public:
void setup() override;
void update_touches() override;

View File

@@ -37,7 +37,7 @@ class CST816ButtonListener {
virtual void update_button(bool state) = 0;
};
class CST816Touchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice {
class CST816Touchscreen final : public touchscreen::Touchscreen, public i2c::I2CDevice {
public:
void setup() override;
void update_touches() override;

View File

@@ -7,7 +7,7 @@
namespace esphome::ct_clamp {
class CTClampSensor : public sensor::Sensor, public PollingComponent {
class CTClampSensor final : public sensor::Sensor, public PollingComponent {
public:
void update() override;
void loop() override;

View File

@@ -8,7 +8,7 @@
namespace esphome::current_based {
class CurrentBasedCover : public cover::Cover, public Component {
class CurrentBasedCover final : public cover::Cover, public Component {
public:
void setup() override;
void loop() override;

View File

@@ -6,7 +6,7 @@
namespace esphome::cwww {
class CWWWLightOutput : public light::LightOutput {
class CWWWLightOutput final : public light::LightOutput {
public:
void set_cold_white(output::FloatOutput *cold_white) { cold_white_ = cold_white; }
void set_warm_white(output::FloatOutput *warm_white) { warm_white_ = warm_white; }

View File

@@ -9,7 +9,7 @@ namespace esphome::dac7678 {
class DAC7678Output;
class DAC7678Channel : public output::FloatOutput, public Parented<DAC7678Output> {
class DAC7678Channel final : public output::FloatOutput, public Parented<DAC7678Output> {
public:
void set_channel(uint8_t channel) { channel_ = channel; }
@@ -24,7 +24,7 @@ class DAC7678Channel : public output::FloatOutput, public Parented<DAC7678Output
};
/// DAC7678 float output component.
class DAC7678Output : public Component, public i2c::I2CDevice {
class DAC7678Output final : public Component, public i2c::I2CDevice {
public:
DAC7678Output() {}

View File

@@ -39,7 +39,7 @@ const uint32_t DAIKIN_MESSAGE_SPACE = 32300;
// State Frame size
const uint8_t DAIKIN_STATE_FRAME_SIZE = 19;
class DaikinClimate : public climate_ir::ClimateIR {
class DaikinClimate final : public climate_ir::ClimateIR {
public:
DaikinClimate()
: climate_ir::ClimateIR(DAIKIN_TEMP_MIN, DAIKIN_TEMP_MAX, 1.0f, true, true,

View File

@@ -45,7 +45,7 @@ const uint8_t DAIKIN_DBG_TOLERANCE = 25;
// State Frame size
const uint8_t DAIKIN_STATE_FRAME_SIZE = 19;
class DaikinArcClimate : public climate_ir::ClimateIR {
class DaikinArcClimate final : public climate_ir::ClimateIR {
public:
DaikinArcClimate()
: climate_ir::ClimateIR(DAIKIN_TEMP_MIN, DAIKIN_TEMP_MAX, 0.5f, true, true,

View File

@@ -48,7 +48,7 @@ const uint8_t DAIKIN_BRC_PREAMBLE_SIZE = 7;
// Transmit Frame size - includes a preamble
const uint8_t DAIKIN_BRC_TRANSMIT_FRAME_SIZE = DAIKIN_BRC_PREAMBLE_SIZE + DAIKIN_BRC_STATE_FRAME_SIZE;
class DaikinBrcClimate : public climate_ir::ClimateIR {
class DaikinBrcClimate final : public climate_ir::ClimateIR {
public:
DaikinBrcClimate()
: climate_ir::ClimateIR(DAIKIN_BRC_TEMP_MIN_C, DAIKIN_BRC_TEMP_MAX_C, 0.5f, true, true,

View File

@@ -6,7 +6,7 @@
namespace esphome::dallas_temp {
class DallasTemperatureSensor : public PollingComponent, public sensor::Sensor, public one_wire::OneWireDevice {
class DallasTemperatureSensor final : public PollingComponent, public sensor::Sensor, public one_wire::OneWireDevice {
public:
void setup() override;
void update() override;

View File

@@ -17,7 +17,7 @@
namespace esphome::daly_bms {
class DalyBmsComponent : public PollingComponent, public uart::UARTDevice {
class DalyBmsComponent final : public PollingComponent, public uart::UARTDevice {
public:
DalyBmsComponent() = default;

View File

@@ -92,7 +92,6 @@ def import_config(
"""Materialise a dashboard-imported device's YAML on disk.
Used by:
- esphome.dashboard (legacy dashboard)
- device-builder (esphome/device-builder) — called from the
``devices/import`` WS handler to seed the YAML for an adopted
factory firmware. Coordinate before changing the kwargs or the

View File

@@ -96,7 +96,7 @@ class DateCall {
optional<uint8_t> day_;
};
template<typename... Ts> class DateSetAction : public Action<Ts...>, public Parented<DateEntity> {
template<typename... Ts> class DateSetAction final : public Action<Ts...>, public Parented<DateEntity> {
public:
TEMPLATABLE_VALUE(ESPTime, date)

View File

@@ -31,7 +31,7 @@ class DateTimeBase : public EntityBase {
#endif
};
class DateTimeStateTrigger : public Trigger<ESPTime> {
class DateTimeStateTrigger final : public Trigger<ESPTime> {
public:
explicit DateTimeStateTrigger(DateTimeBase *parent) : parent_(parent) {
parent->add_on_state_callback([this]() { this->trigger(this->parent_->state_as_esptime()); });

View File

@@ -121,7 +121,7 @@ class DateTimeCall {
optional<uint8_t> second_;
};
template<typename... Ts> class DateTimeSetAction : public Action<Ts...>, public Parented<DateTimeEntity> {
template<typename... Ts> class DateTimeSetAction final : public Action<Ts...>, public Parented<DateTimeEntity> {
public:
TEMPLATABLE_VALUE(ESPTime, datetime)
@@ -136,7 +136,7 @@ template<typename... Ts> class DateTimeSetAction : public Action<Ts...>, public
};
#ifdef USE_TIME
class OnDateTimeTrigger : public Trigger<>, public Component, public Parented<DateTimeEntity> {
class OnDateTimeTrigger final : public Trigger<>, public Component, public Parented<DateTimeEntity> {
public:
void loop() override;

View File

@@ -98,7 +98,7 @@ class TimeCall {
optional<uint8_t> second_;
};
template<typename... Ts> class TimeSetAction : public Action<Ts...>, public Parented<TimeEntity> {
template<typename... Ts> class TimeSetAction final : public Action<Ts...>, public Parented<TimeEntity> {
public:
TEMPLATABLE_VALUE(ESPTime, time)
@@ -113,7 +113,7 @@ template<typename... Ts> class TimeSetAction : public Action<Ts...>, public Pare
};
#ifdef USE_TIME
class OnTimeTrigger : public Trigger<>, public Component, public Parented<TimeEntity> {
class OnTimeTrigger final : public Trigger<>, public Component, public Parented<TimeEntity> {
public:
void loop() override;

View File

@@ -21,7 +21,7 @@ static constexpr size_t WAKEUP_CAUSE_BUFFER_SIZE = 128;
// buf_append_printf is now provided by esphome/core/helpers.h
class DebugComponent : public PollingComponent {
class DebugComponent final : public PollingComponent {
public:
void loop() override;
void update() override;

View File

@@ -70,7 +70,7 @@ template<typename... Ts> class PreventDeepSleepAction;
* and set_run_duration, then set how long the deep sleep should last using set_sleep_duration and optionally
* on the ESP32 set_wakeup_pin.
*/
class DeepSleepComponent : public Component {
class DeepSleepComponent final : public Component {
public:
/// Set the duration in ms the component should sleep once it's in deep sleep mode.
void set_sleep_duration(uint32_t time_ms);
@@ -161,7 +161,7 @@ class DeepSleepComponent : public Component {
extern bool global_has_deep_sleep; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
template<typename... Ts> class EnterDeepSleepAction : public Action<Ts...> {
template<typename... Ts> class EnterDeepSleepAction final : public Action<Ts...> {
public:
EnterDeepSleepAction(DeepSleepComponent *deep_sleep) : deep_sleep_(deep_sleep) {}
TEMPLATABLE_VALUE(uint32_t, sleep_duration);
@@ -233,12 +233,13 @@ template<typename... Ts> class EnterDeepSleepAction : public Action<Ts...> {
#endif
};
template<typename... Ts> class PreventDeepSleepAction : public Action<Ts...>, public Parented<DeepSleepComponent> {
template<typename... Ts>
class PreventDeepSleepAction final : public Action<Ts...>, public Parented<DeepSleepComponent> {
public:
void play(const Ts &...x) override { this->parent_->prevent_deep_sleep(); }
};
template<typename... Ts> class AllowDeepSleepAction : public Action<Ts...>, public Parented<DeepSleepComponent> {
template<typename... Ts> class AllowDeepSleepAction final : public Action<Ts...>, public Parented<DeepSleepComponent> {
public:
void play(const Ts &...x) override { this->parent_->allow_deep_sleep(); }
};

View File

@@ -39,7 +39,7 @@ const uint32_t DELONGHI_ZERO_SPACE = 670;
// State Frame size
const uint8_t DELONGHI_STATE_FRAME_SIZE = 8;
class DelonghiClimate : public climate_ir::ClimateIR {
class DelonghiClimate final : public climate_ir::ClimateIR {
public:
DelonghiClimate()
: climate_ir::ClimateIR(DELONGHI_TEMP_MIN, DELONGHI_TEMP_MAX, 1.0f, true, true,

View File

@@ -13,7 +13,7 @@ enum class DemoAlarmControlPanelType {
TYPE_3,
};
class DemoAlarmControlPanel : public AlarmControlPanel, public Component {
class DemoAlarmControlPanel final : public AlarmControlPanel, public Component {
public:
void setup() override {}

View File

@@ -5,7 +5,7 @@
namespace esphome::demo {
class DemoBinarySensor : public binary_sensor::BinarySensor, public PollingComponent {
class DemoBinarySensor final : public binary_sensor::BinarySensor, public PollingComponent {
public:
void setup() override { this->publish_initial_state(false); }
void update() override {

View File

@@ -5,7 +5,7 @@
namespace esphome::demo {
class DemoButton : public button::Button {
class DemoButton final : public button::Button {
protected:
void press_action() override {}
};

View File

@@ -11,7 +11,7 @@ enum class DemoClimateType {
TYPE_3,
};
class DemoClimate : public climate::Climate, public Component {
class DemoClimate final : public climate::Climate, public Component {
public:
void set_type(DemoClimateType type) { type_ = type; }
void setup() override {

View File

@@ -12,7 +12,7 @@ enum class DemoCoverType {
TYPE_4,
};
class DemoCover : public cover::Cover, public Component {
class DemoCover final : public cover::Cover, public Component {
public:
void set_type(DemoCoverType type) { type_ = type; }
void setup() override {

View File

@@ -9,7 +9,7 @@
namespace esphome::demo {
class DemoDate : public datetime::DateEntity, public Component {
class DemoDate final : public datetime::DateEntity, public Component {
public:
void setup() override {
this->year_ = 2038;

View File

@@ -9,7 +9,7 @@
namespace esphome::demo {
class DemoDateTime : public datetime::DateTimeEntity, public Component {
class DemoDateTime final : public datetime::DateTimeEntity, public Component {
public:
void setup() override {
this->year_ = 2038;

View File

@@ -12,7 +12,7 @@ enum class DemoFanType {
TYPE_4,
};
class DemoFan : public fan::Fan, public Component {
class DemoFan final : public fan::Fan, public Component {
public:
void set_type(DemoFanType type) { type_ = type; }
fan::FanTraits get_traits() override {

View File

@@ -22,7 +22,7 @@ enum class DemoLightType {
TYPE_7,
};
class DemoLight : public light::LightOutput, public Component {
class DemoLight final : public light::LightOutput, public Component {
public:
void set_type(DemoLightType type) { type_ = type; }
light::LightTraits get_traits() override {

View File

@@ -4,7 +4,7 @@
namespace esphome::demo {
class DemoLock : public lock::Lock {
class DemoLock final : public lock::Lock {
protected:
void control(const lock::LockCall &call) override {
auto state = call.get_state();

View File

@@ -11,7 +11,7 @@ enum class DemoNumberType {
TYPE_3,
};
class DemoNumber : public number::Number, public Component {
class DemoNumber final : public number::Number, public Component {
public:
void set_type(DemoNumberType type) { type_ = type; }
void setup() override {

View File

@@ -5,7 +5,7 @@
namespace esphome::demo {
class DemoSelect : public select::Select, public Component {
class DemoSelect final : public select::Select, public Component {
protected:
void control(size_t index) override { this->publish_state(index); }
};

View File

@@ -6,7 +6,7 @@
namespace esphome::demo {
class DemoSensor : public sensor::Sensor, public PollingComponent {
class DemoSensor final : public sensor::Sensor, public PollingComponent {
public:
void update() override {
float val = random_float();

View File

@@ -6,7 +6,7 @@
namespace esphome::demo {
class DemoSwitch : public switch_::Switch, public Component {
class DemoSwitch final : public switch_::Switch, public Component {
public:
void setup() override {
bool initial = random_float() < 0.5;

View File

@@ -5,7 +5,7 @@
namespace esphome::demo {
class DemoText : public text::Text, public Component {
class DemoText final : public text::Text, public Component {
public:
void setup() override { this->publish_state("I am a text entity"); }

View File

@@ -6,7 +6,7 @@
namespace esphome::demo {
class DemoTextSensor : public text_sensor::TextSensor, public PollingComponent {
class DemoTextSensor final : public text_sensor::TextSensor, public PollingComponent {
public:
void update() override {
float val = random_float();

View File

@@ -9,7 +9,7 @@
namespace esphome::demo {
class DemoTime : public datetime::TimeEntity, public Component {
class DemoTime final : public datetime::TimeEntity, public Component {
public:
void setup() override {
this->hour_ = 3;

View File

@@ -9,7 +9,7 @@ enum class DemoValveType {
TYPE_2,
};
class DemoValve : public valve::Valve {
class DemoValve final : public valve::Valve {
public:
valve::ValveTraits get_traits() override {
valve::ValveTraits traits;

View File

@@ -5,7 +5,7 @@
namespace esphome::dew_point {
class DewPointComponent : public Component, public sensor::Sensor {
class DewPointComponent final : public Component, public sensor::Sensor {
public:
void set_temperature_sensor(sensor::Sensor *temperature_sensor) { this->temperature_sensor_ = temperature_sensor; }
void set_humidity_sensor(sensor::Sensor *humidity_sensor) { this->humidity_sensor_ = humidity_sensor; }

View File

@@ -24,7 +24,7 @@ enum Device {
// See the datasheet here:
// https://github.com/DFRobot/DFRobotDFPlayerMini/blob/master/doc/FN-M16P%2BEmbedded%2BMP3%2BAudio%2BModule%2BDatasheet.pdf
class DFPlayer : public uart::UARTDevice, public Component {
class DFPlayer final : public uart::UARTDevice, public Component {
public:
void loop() override;
@@ -82,7 +82,7 @@ class DFPlayer : public uart::UARTDevice, public Component {
DFPLAYER_SIMPLE_ACTION(NextAction, next)
DFPLAYER_SIMPLE_ACTION(PreviousAction, previous)
template<typename... Ts> class PlayMp3Action : public Action<Ts...>, public Parented<DFPlayer> {
template<typename... Ts> class PlayMp3Action final : public Action<Ts...>, public Parented<DFPlayer> {
public:
TEMPLATABLE_VALUE(uint16_t, file)
@@ -92,7 +92,7 @@ template<typename... Ts> class PlayMp3Action : public Action<Ts...>, public Pare
}
};
template<typename... Ts> class PlayFileAction : public Action<Ts...>, public Parented<DFPlayer> {
template<typename... Ts> class PlayFileAction final : public Action<Ts...>, public Parented<DFPlayer> {
public:
TEMPLATABLE_VALUE(uint16_t, file)
TEMPLATABLE_VALUE(bool, loop)
@@ -108,7 +108,7 @@ template<typename... Ts> class PlayFileAction : public Action<Ts...>, public Par
}
};
template<typename... Ts> class PlayFolderAction : public Action<Ts...>, public Parented<DFPlayer> {
template<typename... Ts> class PlayFolderAction final : public Action<Ts...>, public Parented<DFPlayer> {
public:
TEMPLATABLE_VALUE(uint16_t, folder)
TEMPLATABLE_VALUE(uint16_t, file)
@@ -126,7 +126,7 @@ template<typename... Ts> class PlayFolderAction : public Action<Ts...>, public P
}
};
template<typename... Ts> class SetDeviceAction : public Action<Ts...>, public Parented<DFPlayer> {
template<typename... Ts> class SetDeviceAction final : public Action<Ts...>, public Parented<DFPlayer> {
public:
TEMPLATABLE_VALUE(Device, device)
@@ -136,7 +136,7 @@ template<typename... Ts> class SetDeviceAction : public Action<Ts...>, public Pa
}
};
template<typename... Ts> class SetVolumeAction : public Action<Ts...>, public Parented<DFPlayer> {
template<typename... Ts> class SetVolumeAction final : public Action<Ts...>, public Parented<DFPlayer> {
public:
TEMPLATABLE_VALUE(uint8_t, volume)
@@ -146,7 +146,7 @@ template<typename... Ts> class SetVolumeAction : public Action<Ts...>, public Pa
}
};
template<typename... Ts> class SetEqAction : public Action<Ts...>, public Parented<DFPlayer> {
template<typename... Ts> class SetEqAction final : public Action<Ts...>, public Parented<DFPlayer> {
public:
TEMPLATABLE_VALUE(EqPreset, eq)
@@ -165,7 +165,7 @@ DFPLAYER_SIMPLE_ACTION(RandomAction, random)
DFPLAYER_SIMPLE_ACTION(VolumeUpAction, volume_up)
DFPLAYER_SIMPLE_ACTION(VolumeDownAction, volume_down)
template<typename... Ts> class DFPlayerIsPlayingCondition : public Condition<Ts...>, public Parented<DFPlayer> {
template<typename... Ts> class DFPlayerIsPlayingCondition final : public Condition<Ts...>, public Parented<DFPlayer> {
public:
bool check(const Ts &...x) override { return this->parent_->is_playing(); }
};

View File

@@ -533,15 +533,13 @@ def get_board(core_obj=None):
def get_download_types(storage_json):
"""Binary-download entries for a built ESP32 firmware.
Used by:
- esphome.dashboard (legacy "Download .bin" button)
- device-builder (esphome/device-builder) — same dispatch via
``importlib.import_module(f"esphome.components.{platform}")``
then ``module.get_download_types(storage)``. The contract is
"returns ``list[dict]`` with at least ``title`` /
``description`` / ``file`` / ``download`` keys"; please keep
the shape stable so the new dashboard's download panel
doesn't have to special-case per-platform schemas.
Used by device-builder (esphome/device-builder), via
``importlib.import_module(f"esphome.components.{platform}")``
then ``module.get_download_types(storage)``. The contract is
"returns ``list[dict]`` with at least ``title`` /
``description`` / ``file`` / ``download`` keys"; please keep
the shape stable so the download panel
doesn't have to special-case per-platform schemas.
"""
return [
{

Some files were not shown because too many files have changed in this diff Show More