From 591856e7dc3cddb2ea46b2d38a8eb2bf4b0d89f8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 8 Aug 2026 02:30:10 -0500 Subject: [PATCH] Constrain the contract's return types --- esphome/components/ble_device_base/ble_hub.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/esphome/components/ble_device_base/ble_hub.h b/esphome/components/ble_device_base/ble_hub.h index 7d97367846..9e94db27e1 100644 --- a/esphome/components/ble_device_base/ble_hub.h +++ b/esphome/components/ble_device_base/ble_hub.h @@ -13,6 +13,7 @@ #include "ble_device.h" +#include #include namespace esphome::ble_device_base { @@ -102,11 +103,11 @@ concept BLEHubContract = requires(T hub, ESPBTDeviceListener *listener, RawAdver uint8_t *mac) { hub.register_listener(listener); hub.set_raw_advertisement_callback(raw_callback); - T::get_capabilities(); + { T::get_capabilities() } -> std::same_as; hub.get_adapter_mac(mac); - hub.scan_running(); - hub.scan_active(); - hub.request_scan_mode(true); + { hub.scan_running() } -> std::same_as; + { hub.scan_active() } -> std::same_as; + { hub.request_scan_mode(true) } -> std::same_as; }; } // namespace esphome::ble_device_base