diff --git a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp index 616dba891a..4b84257e27 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp @@ -8,8 +8,7 @@ #include "bluetooth_proxy.h" -namespace esphome { -namespace bluetooth_proxy { +namespace esphome::bluetooth_proxy { static const char *const TAG = "bluetooth_proxy.connection"; @@ -422,7 +421,6 @@ esp32_ble_tracker::AdvertisementParserType BluetoothConnection::get_advertisemen return this->proxy_->get_advertisement_parser_type(); } -} // namespace bluetooth_proxy -} // namespace esphome +} // namespace esphome::bluetooth_proxy #endif // USE_ESP32 diff --git a/esphome/components/bluetooth_proxy/bluetooth_connection.h b/esphome/components/bluetooth_proxy/bluetooth_connection.h index 2673238fba..3fed9d531f 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_connection.h +++ b/esphome/components/bluetooth_proxy/bluetooth_connection.h @@ -4,8 +4,7 @@ #include "esphome/components/esp32_ble_client/ble_client_base.h" -namespace esphome { -namespace bluetooth_proxy { +namespace esphome::bluetooth_proxy { class BluetoothProxy; @@ -43,7 +42,6 @@ class BluetoothConnection : public esp32_ble_client::BLEClientBase { // 1 byte used, 1 byte padding }; -} // namespace bluetooth_proxy -} // namespace esphome +} // namespace esphome::bluetooth_proxy #endif // USE_ESP32 diff --git a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp index 8a1a2bff6a..de5508c777 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp @@ -7,8 +7,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace bluetooth_proxy { +namespace esphome::bluetooth_proxy { static const char *const TAG = "bluetooth_proxy"; @@ -502,7 +501,6 @@ void BluetoothProxy::bluetooth_scanner_set_mode(bool active) { BluetoothProxy *global_bluetooth_proxy = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) -} // namespace bluetooth_proxy -} // namespace esphome +} // namespace esphome::bluetooth_proxy #endif // USE_ESP32 diff --git a/esphome/components/bluetooth_proxy/bluetooth_proxy.h b/esphome/components/bluetooth_proxy/bluetooth_proxy.h index b3d9044a2c..d249515fdf 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_proxy.h +++ b/esphome/components/bluetooth_proxy/bluetooth_proxy.h @@ -18,8 +18,7 @@ #include #include -namespace esphome { -namespace bluetooth_proxy { +namespace esphome::bluetooth_proxy { static const esp_err_t ESP_GATT_NOT_CONNECTED = -1; static const int DONE_SENDING_SERVICES = -2; @@ -158,7 +157,6 @@ class BluetoothProxy : public esp32_ble_tracker::ESPBTDeviceListener, public Com extern BluetoothProxy *global_bluetooth_proxy; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) -} // namespace bluetooth_proxy -} // namespace esphome +} // namespace esphome::bluetooth_proxy #endif // USE_ESP32 diff --git a/esphome/components/esp32_ble/ble.cpp b/esphome/components/esp32_ble/ble.cpp index 8b0cf4da98..35c48a711a 100644 --- a/esphome/components/esp32_ble/ble.cpp +++ b/esphome/components/esp32_ble/ble.cpp @@ -19,8 +19,7 @@ #include #endif -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { static const char *const TAG = "esp32_ble"; @@ -538,7 +537,6 @@ uint64_t ble_addr_to_uint64(const esp_bd_addr_t address) { ESP32BLE *global_ble = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble/ble.h b/esphome/components/esp32_ble/ble.h index 2c5697df82..543b2f26a3 100644 --- a/esphome/components/esp32_ble/ble.h +++ b/esphome/components/esp32_ble/ble.h @@ -21,8 +21,7 @@ #include #include -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { // Maximum number of BLE scan results to buffer // Sized to handle bursts of advertisements while allowing for processing delays @@ -191,7 +190,6 @@ template class BLEDisableAction : public Action { void play(Ts... x) override { global_ble->disable(); } }; -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble/ble_advertising.cpp b/esphome/components/esp32_ble/ble_advertising.cpp index 8d43b5af33..6a0d677aa7 100644 --- a/esphome/components/esp32_ble/ble_advertising.cpp +++ b/esphome/components/esp32_ble/ble_advertising.cpp @@ -8,8 +8,7 @@ #include "esphome/core/log.h" #include "esphome/core/application.h" -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { static const char *const TAG = "esp32_ble.advertising"; @@ -160,7 +159,6 @@ void BLEAdvertising::register_raw_advertisement_callback(std::functionraw_advertisements_callbacks_.push_back(std::move(callback)); } -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble/ble_advertising.h b/esphome/components/esp32_ble/ble_advertising.h index 0b2142115d..2254251486 100644 --- a/esphome/components/esp32_ble/ble_advertising.h +++ b/esphome/components/esp32_ble/ble_advertising.h @@ -10,8 +10,7 @@ #include #include -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { using raw_adv_data_t = struct { uint8_t *data; @@ -55,7 +54,6 @@ class BLEAdvertising { int8_t current_adv_index_{-1}; // -1 means standard scan response }; -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble/ble_event.h b/esphome/components/esp32_ble/ble_event.h index 9268c710f3..884fc9ba65 100644 --- a/esphome/components/esp32_ble/ble_event.h +++ b/esphome/components/esp32_ble/ble_event.h @@ -11,8 +11,7 @@ #include "ble_scan_result.h" -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { // Compile-time verification that ESP-IDF scan complete events only contain a status field // This ensures our reinterpret_cast in ble.cpp is safe @@ -395,7 +394,6 @@ static_assert(sizeof(esp_ble_sec_t) <= 73, "esp_ble_sec_t is larger than BLEScan // BLEEvent total size: 84 bytes (80 byte union + 1 byte type + 3 bytes padding) -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble/ble_scan_result.h b/esphome/components/esp32_ble/ble_scan_result.h index 49b0d5523d..980b39b0b2 100644 --- a/esphome/components/esp32_ble/ble_scan_result.h +++ b/esphome/components/esp32_ble/ble_scan_result.h @@ -4,8 +4,7 @@ #include -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { // Structure for BLE scan results - only fields we actually use struct __attribute__((packed)) BLEScanResult { @@ -18,7 +17,6 @@ struct __attribute__((packed)) BLEScanResult { uint8_t search_evt; }; // ~73 bytes vs ~400 bytes for full esp_ble_gap_cb_param_t -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble/ble_uuid.cpp b/esphome/components/esp32_ble/ble_uuid.cpp index aa1edd96b2..fc6981acd3 100644 --- a/esphome/components/esp32_ble/ble_uuid.cpp +++ b/esphome/components/esp32_ble/ble_uuid.cpp @@ -7,8 +7,7 @@ #include #include "esphome/core/log.h" -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { static const char *const TAG = "esp32_ble"; @@ -189,7 +188,6 @@ std::string ESPBTUUID::to_string() const { return ""; } -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble/ble_uuid.h b/esphome/components/esp32_ble/ble_uuid.h index 06f84d4da7..150ca359d3 100644 --- a/esphome/components/esp32_ble/ble_uuid.h +++ b/esphome/components/esp32_ble/ble_uuid.h @@ -8,8 +8,7 @@ #include #include -namespace esphome { -namespace esp32_ble { +namespace esphome::esp32_ble { class ESPBTUUID { public: @@ -41,7 +40,6 @@ class ESPBTUUID { esp_bt_uuid_t uuid_; }; -} // namespace esp32_ble -} // namespace esphome +} // namespace esphome::esp32_ble #endif diff --git a/esphome/components/esp32_ble_tracker/automation.h b/esphome/components/esp32_ble_tracker/automation.h index ef677922e3..c0e6eee138 100644 --- a/esphome/components/esp32_ble_tracker/automation.h +++ b/esphome/components/esp32_ble_tracker/automation.h @@ -5,8 +5,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace esp32_ble_tracker { +namespace esphome::esp32_ble_tracker { #ifdef USE_ESP32_BLE_DEVICE class ESPBTAdvertiseTrigger : public Trigger, public ESPBTDeviceListener { public: @@ -108,7 +107,6 @@ template class ESP32BLEStopScanAction : public Action, pu void play(Ts... x) override { this->parent_->stop_scan(); } }; -} // namespace esp32_ble_tracker -} // namespace esphome +} // namespace esphome::esp32_ble_tracker #endif diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp index 96003073d7..e0029ad15b 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp @@ -35,8 +35,7 @@ // bt_trace.h #undef TAG -namespace esphome { -namespace esp32_ble_tracker { +namespace esphome::esp32_ble_tracker { static const char *const TAG = "esp32_ble_tracker"; @@ -882,7 +881,6 @@ bool ESPBTDevice::resolve_irk(const uint8_t *irk) const { } #endif // USE_ESP32_BLE_DEVICE -} // namespace esp32_ble_tracker -} // namespace esphome +} // namespace esphome::esp32_ble_tracker #endif // USE_ESP32 diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h index e10f4551e8..e1119c0e18 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h @@ -22,8 +22,7 @@ #include "esphome/components/esp32_ble/ble.h" #include "esphome/components/esp32_ble/ble_uuid.h" -namespace esphome { -namespace esp32_ble_tracker { +namespace esphome::esp32_ble_tracker { using namespace esp32_ble; @@ -321,7 +320,6 @@ class ESP32BLETracker : public Component, // NOLINTNEXTLINE extern ESP32BLETracker *global_esp32_ble_tracker; -} // namespace esp32_ble_tracker -} // namespace esphome +} // namespace esphome::esp32_ble_tracker #endif