From ab1d2de78e407fad54077606d48d4be86c8b1d6c Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Thu, 7 May 2026 19:28:30 -0400 Subject: [PATCH] [clang-tidy] Concatenate nested namespaces (4/7: components n-r) (#16301) --- esphome/components/nau7802/nau7802.cpp | 6 ++---- esphome/components/nau7802/nau7802.h | 6 ++---- esphome/components/nfc/automation.cpp | 6 ++---- esphome/components/nfc/automation.h | 6 ++---- esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp | 6 ++---- esphome/components/nfc/binary_sensor/nfc_binary_sensor.h | 6 ++---- esphome/components/nfc/nci_core.h | 6 ++---- esphome/components/nfc/nci_message.cpp | 6 ++---- esphome/components/nfc/nci_message.h | 6 ++---- esphome/components/nfc/ndef_message.cpp | 6 ++---- esphome/components/nfc/ndef_message.h | 6 ++---- esphome/components/nfc/ndef_record.cpp | 6 ++---- esphome/components/nfc/ndef_record.h | 6 ++---- esphome/components/nfc/ndef_record_text.cpp | 6 ++---- esphome/components/nfc/ndef_record_text.h | 6 ++---- esphome/components/nfc/ndef_record_uri.cpp | 6 ++---- esphome/components/nfc/ndef_record_uri.h | 6 ++---- esphome/components/nfc/nfc.cpp | 6 ++---- esphome/components/nfc/nfc.h | 6 ++---- esphome/components/nfc/nfc_helpers.cpp | 6 ++---- esphome/components/nfc/nfc_helpers.h | 6 ++---- esphome/components/nfc/nfc_tag.cpp | 6 ++---- esphome/components/nfc/nfc_tag.h | 6 ++---- esphome/components/noblex/noblex.cpp | 6 ++---- esphome/components/noblex/noblex.h | 6 ++---- esphome/components/npi19/npi19.cpp | 6 ++---- esphome/components/npi19/npi19.h | 6 ++---- esphome/components/ntc/ntc.cpp | 6 ++---- esphome/components/ntc/ntc.h | 6 ++---- esphome/components/one_wire/one_wire.cpp | 6 ++---- esphome/components/one_wire/one_wire.h | 6 ++---- esphome/components/one_wire/one_wire_bus.cpp | 6 ++---- esphome/components/one_wire/one_wire_bus.h | 6 ++---- esphome/components/opentherm/automation.h | 6 ++---- esphome/components/opentherm/hub.cpp | 6 ++---- esphome/components/opentherm/hub.h | 6 ++---- esphome/components/opentherm/input.h | 6 ++---- esphome/components/opentherm/number/opentherm_number.cpp | 6 ++---- esphome/components/opentherm/number/opentherm_number.h | 6 ++---- esphome/components/opentherm/opentherm.cpp | 6 ++---- esphome/components/opentherm/opentherm.h | 6 ++---- esphome/components/opentherm/opentherm_macros.h | 7 +++---- esphome/components/opentherm/output/opentherm_output.cpp | 6 ++---- esphome/components/opentherm/output/opentherm_output.h | 6 ++---- esphome/components/opentherm/switch/opentherm_switch.cpp | 6 ++---- esphome/components/opentherm/switch/opentherm_switch.h | 6 ++---- esphome/components/opt3001/opt3001.cpp | 6 ++---- esphome/components/opt3001/opt3001.h | 6 ++---- esphome/components/output/automation.cpp | 6 ++---- esphome/components/output/automation.h | 6 ++---- esphome/components/output/binary_output.h | 6 ++---- esphome/components/output/button/output_button.cpp | 6 ++---- esphome/components/output/button/output_button.h | 6 ++---- esphome/components/output/float_output.cpp | 6 ++---- esphome/components/output/float_output.h | 6 ++---- esphome/components/output/lock/output_lock.cpp | 6 ++---- esphome/components/output/lock/output_lock.h | 6 ++---- esphome/components/output/switch/output_switch.cpp | 6 ++---- esphome/components/output/switch/output_switch.h | 6 ++---- esphome/components/packet_transport/packet_transport.cpp | 6 ++---- esphome/components/packet_transport/packet_transport.h | 6 ++---- esphome/components/partition/light_partition.cpp | 6 ++---- esphome/components/partition/light_partition.h | 6 ++---- esphome/components/pca6416a/pca6416a.cpp | 6 ++---- esphome/components/pca6416a/pca6416a.h | 6 ++---- esphome/components/pca9554/pca9554.cpp | 6 ++---- esphome/components/pca9554/pca9554.h | 6 ++---- esphome/components/pca9685/pca9685_output.cpp | 6 ++---- esphome/components/pca9685/pca9685_output.h | 6 ++---- esphome/components/pcd8544/pcd_8544.cpp | 6 ++---- esphome/components/pcd8544/pcd_8544.h | 6 ++---- esphome/components/pcf85063/pcf85063.cpp | 6 ++---- esphome/components/pcf85063/pcf85063.h | 6 ++---- esphome/components/pcf8563/pcf8563.cpp | 6 ++---- esphome/components/pcf8563/pcf8563.h | 6 ++---- esphome/components/pcf8574/pcf8574.cpp | 6 ++---- esphome/components/pcf8574/pcf8574.h | 6 ++---- esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp | 6 ++---- esphome/components/pi4ioe5v6408/pi4ioe5v6408.h | 6 ++---- esphome/components/pid/pid_autotuner.cpp | 6 ++---- esphome/components/pid/pid_autotuner.h | 6 ++---- esphome/components/pid/pid_climate.cpp | 6 ++---- esphome/components/pid/pid_climate.h | 6 ++---- esphome/components/pid/pid_controller.cpp | 6 ++---- esphome/components/pid/pid_controller.h | 6 ++---- esphome/components/pid/sensor/pid_climate_sensor.cpp | 6 ++---- esphome/components/pid/sensor/pid_climate_sensor.h | 6 ++---- esphome/components/pipsolar/output/pipsolar_output.cpp | 6 ++---- esphome/components/pipsolar/output/pipsolar_output.h | 6 ++---- esphome/components/pipsolar/pipsolar.cpp | 6 ++---- esphome/components/pipsolar/pipsolar.h | 6 ++---- esphome/components/pipsolar/switch/pipsolar_switch.cpp | 6 ++---- esphome/components/pipsolar/switch/pipsolar_switch.h | 6 ++---- esphome/components/pm1006/pm1006.cpp | 6 ++---- esphome/components/pm1006/pm1006.h | 6 ++---- esphome/components/pm2005/pm2005.cpp | 6 ++---- esphome/components/pm2005/pm2005.h | 6 ++---- esphome/components/pmsa003i/pmsa003i.cpp | 6 ++---- esphome/components/pmsa003i/pmsa003i.h | 6 ++---- esphome/components/pmwcs3/pmwcs3.cpp | 6 ++---- esphome/components/pmwcs3/pmwcs3.h | 6 ++---- esphome/components/pn532/pn532.cpp | 6 ++---- esphome/components/pn532/pn532.h | 6 ++---- esphome/components/pn532/pn532_mifare_classic.cpp | 6 ++---- esphome/components/pn532/pn532_mifare_ultralight.cpp | 6 ++---- esphome/components/pn532_i2c/pn532_i2c.cpp | 6 ++---- esphome/components/pn532_i2c/pn532_i2c.h | 6 ++---- esphome/components/pn532_spi/pn532_spi.cpp | 6 ++---- esphome/components/pn532_spi/pn532_spi.h | 6 ++---- esphome/components/pn7150/automation.h | 6 ++---- esphome/components/pn7150/pn7150.cpp | 6 ++---- esphome/components/pn7150/pn7150.h | 6 ++---- esphome/components/pn7150/pn7150_mifare_classic.cpp | 6 ++---- esphome/components/pn7150/pn7150_mifare_ultralight.cpp | 6 ++---- esphome/components/pn7150_i2c/pn7150_i2c.cpp | 6 ++---- esphome/components/pn7150_i2c/pn7150_i2c.h | 6 ++---- esphome/components/pn7160/automation.h | 6 ++---- esphome/components/pn7160/pn7160.cpp | 6 ++---- esphome/components/pn7160/pn7160.h | 6 ++---- esphome/components/pn7160/pn7160_mifare_classic.cpp | 6 ++---- esphome/components/pn7160/pn7160_mifare_ultralight.cpp | 6 ++---- esphome/components/pn7160_i2c/pn7160_i2c.cpp | 6 ++---- esphome/components/pn7160_i2c/pn7160_i2c.h | 6 ++---- esphome/components/pn7160_spi/pn7160_spi.cpp | 6 ++---- esphome/components/pn7160_spi/pn7160_spi.h | 6 ++---- esphome/components/power_supply/power_supply.cpp | 6 ++---- esphome/components/power_supply/power_supply.h | 6 ++---- esphome/components/preferences/syncer.h | 6 ++---- esphome/components/prometheus/prometheus_handler.cpp | 7 +++---- esphome/components/prometheus/prometheus_handler.h | 7 +++---- esphome/components/psram/psram.cpp | 6 ++---- esphome/components/psram/psram.h | 6 ++---- esphome/components/pulse_counter/automation.h | 7 ++----- esphome/components/pulse_counter/pulse_counter_sensor.cpp | 6 ++---- esphome/components/pulse_counter/pulse_counter_sensor.h | 6 ++---- esphome/components/pulse_meter/automation.h | 7 ++----- esphome/components/pulse_meter/pulse_meter_sensor.cpp | 6 ++---- esphome/components/pulse_meter/pulse_meter_sensor.h | 6 ++---- esphome/components/pulse_width/pulse_width.cpp | 6 ++---- esphome/components/pulse_width/pulse_width.h | 6 ++---- .../components/pvvx_mithermometer/display/pvvx_display.cpp | 7 +++---- .../components/pvvx_mithermometer/display/pvvx_display.h | 6 ++---- .../components/pvvx_mithermometer/pvvx_mithermometer.cpp | 6 ++---- esphome/components/pvvx_mithermometer/pvvx_mithermometer.h | 6 ++---- esphome/components/pylontech/pylontech.cpp | 6 ++---- esphome/components/pylontech/pylontech.h | 6 ++---- esphome/components/pylontech/sensor/pylontech_sensor.cpp | 6 ++---- esphome/components/pylontech/sensor/pylontech_sensor.h | 6 ++---- .../pylontech/text_sensor/pylontech_text_sensor.cpp | 6 ++---- .../pylontech/text_sensor/pylontech_text_sensor.h | 6 ++---- esphome/components/pzem004t/pzem004t.cpp | 6 ++---- esphome/components/pzem004t/pzem004t.h | 6 ++---- esphome/components/pzemac/pzemac.cpp | 6 ++---- esphome/components/pzemac/pzemac.h | 6 ++---- esphome/components/pzemdc/pzemdc.cpp | 6 ++---- esphome/components/pzemdc/pzemdc.h | 6 ++---- esphome/components/qmc5883l/qmc5883l.cpp | 6 ++---- esphome/components/qmc5883l/qmc5883l.h | 6 ++---- esphome/components/qmp6988/qmp6988.cpp | 6 ++---- esphome/components/qmp6988/qmp6988.h | 6 ++---- esphome/components/qr_code/qr_code.cpp | 6 ++---- esphome/components/qwiic_pir/qwiic_pir.cpp | 6 ++---- esphome/components/qwiic_pir/qwiic_pir.h | 6 ++---- esphome/components/radon_eye_ble/radon_eye_listener.cpp | 6 ++---- esphome/components/radon_eye_ble/radon_eye_listener.h | 6 ++---- esphome/components/radon_eye_rd200/radon_eye_rd200.cpp | 6 ++---- esphome/components/radon_eye_rd200/radon_eye_rd200.h | 6 ++---- esphome/components/rc522/rc522.cpp | 6 ++---- esphome/components/rc522/rc522.h | 6 ++---- esphome/components/rc522_i2c/rc522_i2c.cpp | 6 ++---- esphome/components/rc522_i2c/rc522_i2c.h | 6 ++---- esphome/components/rc522_spi/rc522_spi.cpp | 6 ++---- esphome/components/rc522_spi/rc522_spi.h | 6 ++---- esphome/components/rdm6300/rdm6300.cpp | 6 ++---- esphome/components/rdm6300/rdm6300.h | 6 ++---- esphome/components/remote_base/abbwelcome_protocol.cpp | 6 ++---- esphome/components/remote_base/abbwelcome_protocol.h | 6 ++---- esphome/components/remote_base/aeha_protocol.cpp | 6 ++---- esphome/components/remote_base/aeha_protocol.h | 6 ++---- esphome/components/remote_base/beo4_protocol.cpp | 6 ++---- esphome/components/remote_base/beo4_protocol.h | 6 ++---- esphome/components/remote_base/byronsx_protocol.cpp | 6 ++---- esphome/components/remote_base/byronsx_protocol.h | 6 ++---- esphome/components/remote_base/canalsat_protocol.cpp | 6 ++---- esphome/components/remote_base/canalsat_protocol.h | 6 ++---- esphome/components/remote_base/coolix_protocol.cpp | 6 ++---- esphome/components/remote_base/coolix_protocol.h | 6 ++---- esphome/components/remote_base/dish_protocol.cpp | 6 ++---- esphome/components/remote_base/dish_protocol.h | 6 ++---- esphome/components/remote_base/dooya_protocol.cpp | 6 ++---- esphome/components/remote_base/dooya_protocol.h | 6 ++---- esphome/components/remote_base/drayton_protocol.cpp | 6 ++---- esphome/components/remote_base/drayton_protocol.h | 6 ++---- esphome/components/remote_base/dyson_protocol.cpp | 6 ++---- esphome/components/remote_base/dyson_protocol.h | 6 ++---- esphome/components/remote_base/gobox_protocol.cpp | 6 ++---- esphome/components/remote_base/gobox_protocol.h | 6 ++---- esphome/components/remote_base/haier_protocol.cpp | 6 ++---- esphome/components/remote_base/haier_protocol.h | 6 ++---- esphome/components/remote_base/jvc_protocol.cpp | 6 ++---- esphome/components/remote_base/jvc_protocol.h | 6 ++---- esphome/components/remote_base/keeloq_protocol.cpp | 6 ++---- esphome/components/remote_base/keeloq_protocol.h | 6 ++---- esphome/components/remote_base/lg_protocol.cpp | 6 ++---- esphome/components/remote_base/lg_protocol.h | 6 ++---- esphome/components/remote_base/magiquest_protocol.cpp | 6 ++---- esphome/components/remote_base/magiquest_protocol.h | 6 ++---- esphome/components/remote_base/midea_protocol.cpp | 6 ++---- esphome/components/remote_base/midea_protocol.h | 6 ++---- esphome/components/remote_base/mirage_protocol.cpp | 6 ++---- esphome/components/remote_base/mirage_protocol.h | 6 ++---- esphome/components/remote_base/nec_protocol.cpp | 6 ++---- esphome/components/remote_base/nec_protocol.h | 6 ++---- esphome/components/remote_base/nexa_protocol.cpp | 6 ++---- esphome/components/remote_base/nexa_protocol.h | 6 ++---- esphome/components/remote_base/panasonic_protocol.cpp | 6 ++---- esphome/components/remote_base/panasonic_protocol.h | 6 ++---- esphome/components/remote_base/pioneer_protocol.cpp | 6 ++---- esphome/components/remote_base/pioneer_protocol.h | 6 ++---- esphome/components/remote_base/pronto_protocol.cpp | 6 ++---- esphome/components/remote_base/pronto_protocol.h | 6 ++---- esphome/components/remote_base/raw_protocol.cpp | 6 ++---- esphome/components/remote_base/raw_protocol.h | 6 ++---- esphome/components/remote_base/rc5_protocol.cpp | 6 ++---- esphome/components/remote_base/rc5_protocol.h | 6 ++---- esphome/components/remote_base/rc6_protocol.cpp | 6 ++---- esphome/components/remote_base/rc6_protocol.h | 6 ++---- esphome/components/remote_base/rc_switch_protocol.cpp | 6 ++---- esphome/components/remote_base/rc_switch_protocol.h | 6 ++---- esphome/components/remote_base/remote_base.cpp | 6 ++---- esphome/components/remote_base/remote_base.h | 6 ++---- esphome/components/remote_base/roomba_protocol.cpp | 6 ++---- esphome/components/remote_base/roomba_protocol.h | 6 ++---- esphome/components/remote_base/samsung36_protocol.cpp | 6 ++---- esphome/components/remote_base/samsung36_protocol.h | 6 ++---- esphome/components/remote_base/samsung_protocol.cpp | 6 ++---- esphome/components/remote_base/samsung_protocol.h | 6 ++---- esphome/components/remote_base/sony_protocol.cpp | 6 ++---- esphome/components/remote_base/sony_protocol.h | 6 ++---- esphome/components/remote_base/symphony_protocol.cpp | 6 ++---- esphome/components/remote_base/symphony_protocol.h | 6 ++---- esphome/components/remote_base/toshiba_ac_protocol.cpp | 6 ++---- esphome/components/remote_base/toshiba_ac_protocol.h | 6 ++---- esphome/components/remote_base/toto_protocol.cpp | 6 ++---- esphome/components/remote_base/toto_protocol.h | 6 ++---- esphome/components/resampler/speaker/resampler_speaker.cpp | 6 ++---- esphome/components/resampler/speaker/resampler_speaker.h | 6 ++---- esphome/components/resistance/resistance_sensor.cpp | 6 ++---- esphome/components/resistance/resistance_sensor.h | 6 ++---- esphome/components/restart/button/restart_button.cpp | 6 ++---- esphome/components/restart/button/restart_button.h | 6 ++---- esphome/components/restart/switch/restart_switch.cpp | 6 ++---- esphome/components/restart/switch/restart_switch.h | 6 ++---- esphome/components/rf_bridge/rf_bridge.cpp | 6 ++---- esphome/components/rf_bridge/rf_bridge.h | 6 ++---- esphome/components/rgb/rgb_light_output.h | 6 ++---- esphome/components/rgbct/rgbct_light_output.h | 6 ++---- esphome/components/rgbw/rgbw_light_output.h | 6 ++---- esphome/components/rgbww/rgbww_light_output.h | 6 ++---- esphome/components/rotary_encoder/rotary_encoder.cpp | 6 ++---- esphome/components/rotary_encoder/rotary_encoder.h | 6 ++---- esphome/components/ruuvi_ble/ruuvi_ble.cpp | 6 ++---- esphome/components/ruuvi_ble/ruuvi_ble.h | 6 ++---- esphome/components/ruuvitag/ruuvitag.cpp | 6 ++---- esphome/components/ruuvitag/ruuvitag.h | 6 ++---- esphome/components/rx8130/rx8130.cpp | 6 ++---- esphome/components/rx8130/rx8130.h | 6 ++---- 267 files changed, 538 insertions(+), 1070 deletions(-) diff --git a/esphome/components/nau7802/nau7802.cpp b/esphome/components/nau7802/nau7802.cpp index 66d36dd741..4d73ed6dd0 100644 --- a/esphome/components/nau7802/nau7802.cpp +++ b/esphome/components/nau7802/nau7802.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include "esphome/core/hal.h" -namespace esphome { -namespace nau7802 { +namespace esphome::nau7802 { static const char *const TAG = "nau7802"; @@ -313,5 +312,4 @@ void NAU7802Sensor::update() { bool NAU7802Sensor::is_data_ready_() { return this->reg(PU_CTRL_REG).get() & PU_CTRL_CYCLE_READY; } -} // namespace nau7802 -} // namespace esphome +} // namespace esphome::nau7802 diff --git a/esphome/components/nau7802/nau7802.h b/esphome/components/nau7802/nau7802.h index ae39e167a4..67f36ca677 100644 --- a/esphome/components/nau7802/nau7802.h +++ b/esphome/components/nau7802/nau7802.h @@ -7,8 +7,7 @@ #include -namespace esphome { -namespace nau7802 { +namespace esphome::nau7802 { enum NAU7802Gain { NAU7802_GAIN_128 = 0b111, @@ -114,5 +113,4 @@ template class NAU7802CalbrateGainAction : public Action, void play(const Ts &...x) override { this->parent_->calibrate_gain(); } }; -} // namespace nau7802 -} // namespace esphome +} // namespace esphome::nau7802 diff --git a/esphome/components/nfc/automation.cpp b/esphome/components/nfc/automation.cpp index e2956e4c12..7129aaf2af 100644 --- a/esphome/components/nfc/automation.cpp +++ b/esphome/components/nfc/automation.cpp @@ -1,13 +1,11 @@ #include "automation.h" #include "nfc.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { void NfcOnTagTrigger::process(const std::unique_ptr &tag) { char uid_buf[FORMAT_UID_BUFFER_SIZE]; this->trigger(std::string(format_uid_to(uid_buf, tag->get_uid())), *tag); } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/automation.h b/esphome/components/nfc/automation.h index 565b71bdd9..0ac3e3b8b6 100644 --- a/esphome/components/nfc/automation.h +++ b/esphome/components/nfc/automation.h @@ -5,13 +5,11 @@ #include "nfc.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { class NfcOnTagTrigger : public Trigger { public: void process(const std::unique_ptr &tag); }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp index 524ad5a413..6e8162fc91 100644 --- a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp +++ b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp @@ -3,8 +3,7 @@ #include "../nfc_helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc.binary_sensor"; @@ -112,5 +111,4 @@ void NfcTagBinarySensor::tag_on(NfcTag &tag) { } } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.h b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.h index 0a7ca0ca76..b3448a57cc 100644 --- a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.h +++ b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.h @@ -6,8 +6,7 @@ #include "esphome/core/component.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { class NfcTagBinarySensor : public binary_sensor::BinarySensor, public Component, @@ -34,5 +33,4 @@ class NfcTagBinarySensor : public binary_sensor::BinarySensor, NfcTagUid uid_; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nci_core.h b/esphome/components/nfc/nci_core.h index 6b42070ed0..dd4bc547f6 100644 --- a/esphome/components/nfc/nci_core.h +++ b/esphome/components/nfc/nci_core.h @@ -4,8 +4,7 @@ #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { // Header info static constexpr uint8_t NCI_PKT_HEADER_SIZE = 3; // NCI packet (pkt) headers are always three bytes @@ -140,5 +139,4 @@ static constexpr uint8_t RF_INTF_ACTIVATED_NTF_INIT_CRED = 5 + NCI_PKT_HEADER_SI static constexpr uint8_t RF_INTF_ACTIVATED_NTF_RF_TECH_LENGTH = 6 + NCI_PKT_HEADER_SIZE; static constexpr uint8_t RF_INTF_ACTIVATED_NTF_RF_TECH_PARAMS = 7 + NCI_PKT_HEADER_SIZE; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nci_message.cpp b/esphome/components/nfc/nci_message.cpp index c6b21f6ae0..0b60fd0ade 100644 --- a/esphome/components/nfc/nci_message.cpp +++ b/esphome/components/nfc/nci_message.cpp @@ -4,8 +4,7 @@ #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "NciMessage"; @@ -162,5 +161,4 @@ void NciMessage::set_payload(const std::vector &payload) { this->nci_message_ = message; } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nci_message.h b/esphome/components/nfc/nci_message.h index 0c5c871f74..8e8b110336 100644 --- a/esphome/components/nfc/nci_message.h +++ b/esphome/components/nfc/nci_message.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { class NciMessage { public: @@ -46,5 +45,4 @@ class NciMessage { std::vector nci_message_{0, 0, 0}; // three bytes, MT/PBF/GID, OID, payload length/size }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_message.cpp b/esphome/components/nfc/ndef_message.cpp index 35028555c5..ba3aa77e34 100644 --- a/esphome/components/nfc/ndef_message.cpp +++ b/esphome/components/nfc/ndef_message.cpp @@ -1,8 +1,7 @@ #include "ndef_message.h" #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc.ndef_message"; @@ -120,5 +119,4 @@ std::vector NdefMessage::encode() { return data; } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_message.h b/esphome/components/nfc/ndef_message.h index 48f79b8854..7d431b2296 100644 --- a/esphome/components/nfc/ndef_message.h +++ b/esphome/components/nfc/ndef_message.h @@ -9,8 +9,7 @@ #include "ndef_record_text.h" #include "ndef_record_uri.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static constexpr uint8_t MAX_NDEF_RECORDS = 4; @@ -38,5 +37,4 @@ class NdefMessage { std::vector> records_; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_record.cpp b/esphome/components/nfc/ndef_record.cpp index 540ba62940..8b9e7023ed 100644 --- a/esphome/components/nfc/ndef_record.cpp +++ b/esphome/components/nfc/ndef_record.cpp @@ -1,7 +1,6 @@ #include "ndef_record.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc.ndef_record"; @@ -61,5 +60,4 @@ uint8_t NdefRecord::create_flag_byte(bool first, bool last, size_t payload_size) return value; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_record.h b/esphome/components/nfc/ndef_record.h index 1a7c24aee9..fc9fe25402 100644 --- a/esphome/components/nfc/ndef_record.h +++ b/esphome/components/nfc/ndef_record.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { static constexpr uint8_t TNF_EMPTY = 0x00; static constexpr uint8_t TNF_WELL_KNOWN = 0x01; @@ -53,5 +52,4 @@ class NdefRecord { std::string payload_; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_record_text.cpp b/esphome/components/nfc/ndef_record_text.cpp index 8a9a2cb014..8ad687daf8 100644 --- a/esphome/components/nfc/ndef_record_text.cpp +++ b/esphome/components/nfc/ndef_record_text.cpp @@ -1,8 +1,7 @@ #include "ndef_record_text.h" #include "ndef_record.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc.ndef_record_text"; @@ -41,5 +40,4 @@ std::vector NdefRecordText::get_encoded_payload() { return data; } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_record_text.h b/esphome/components/nfc/ndef_record_text.h index e6c15704f0..ceee585e89 100644 --- a/esphome/components/nfc/ndef_record_text.h +++ b/esphome/components/nfc/ndef_record_text.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { class NdefRecordText : public NdefRecord { public: @@ -39,5 +38,4 @@ class NdefRecordText : public NdefRecord { std::string language_code_; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_record_uri.cpp b/esphome/components/nfc/ndef_record_uri.cpp index 9064f04f29..e2c6d21a34 100644 --- a/esphome/components/nfc/ndef_record_uri.cpp +++ b/esphome/components/nfc/ndef_record_uri.cpp @@ -1,7 +1,6 @@ #include "ndef_record_uri.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc.ndef_record_uri"; @@ -44,5 +43,4 @@ std::vector NdefRecordUri::get_encoded_payload() { return data; } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/ndef_record_uri.h b/esphome/components/nfc/ndef_record_uri.h index 2f7790a9a9..619cdf7cf3 100644 --- a/esphome/components/nfc/ndef_record_uri.h +++ b/esphome/components/nfc/ndef_record_uri.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { static constexpr uint8_t PAYLOAD_IDENTIFIERS_COUNT = 0x23; static const char *const PAYLOAD_IDENTIFIERS[] = {"", @@ -74,5 +73,4 @@ class NdefRecordUri : public NdefRecord { std::string uri_; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nfc.cpp b/esphome/components/nfc/nfc.cpp index 55543cd292..99e476dbdf 100644 --- a/esphome/components/nfc/nfc.cpp +++ b/esphome/components/nfc/nfc.cpp @@ -3,8 +3,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc"; @@ -108,5 +107,4 @@ bool mifare_classic_is_trailer_block(uint8_t block_num) { } } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nfc.h b/esphome/components/nfc/nfc.h index 8ca5cb7ea4..42ef993913 100644 --- a/esphome/components/nfc/nfc.h +++ b/esphome/components/nfc/nfc.h @@ -9,8 +9,7 @@ #include #include -namespace esphome { -namespace nfc { +namespace esphome::nfc { static constexpr uint8_t MIFARE_CLASSIC_BLOCK_SIZE = 16; static constexpr uint8_t MIFARE_CLASSIC_LONG_TLV_SIZE = 4; @@ -95,5 +94,4 @@ class Nfcc { std::vector tag_listeners_; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nfc_helpers.cpp b/esphome/components/nfc/nfc_helpers.cpp index fb0954a833..6c8a5b626d 100644 --- a/esphome/components/nfc/nfc_helpers.cpp +++ b/esphome/components/nfc/nfc_helpers.cpp @@ -1,7 +1,6 @@ #include "nfc_helpers.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc.helpers"; @@ -43,5 +42,4 @@ std::string get_random_ha_tag_ndef() { return uri; } -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nfc_helpers.h b/esphome/components/nfc/nfc_helpers.h index 74f5beba13..dedc602bf1 100644 --- a/esphome/components/nfc/nfc_helpers.h +++ b/esphome/components/nfc/nfc_helpers.h @@ -2,8 +2,7 @@ #include "nfc_tag.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char HA_TAG_ID_EXT_RECORD_TYPE[] = "android.com:pkg"; static const char HA_TAG_ID_EXT_RECORD_PAYLOAD[] = "io.homeassistant.companion.android"; @@ -13,5 +12,4 @@ std::string get_ha_tag_ndef(NfcTag &tag); std::string get_random_ha_tag_ndef(); bool has_ha_tag_ndef(NfcTag &tag); -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nfc_tag.cpp b/esphome/components/nfc/nfc_tag.cpp index c5c15b00ec..c43210517d 100644 --- a/esphome/components/nfc/nfc_tag.cpp +++ b/esphome/components/nfc/nfc_tag.cpp @@ -1,9 +1,7 @@ #include "nfc_tag.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { static const char *const TAG = "nfc.tag"; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/nfc/nfc_tag.h b/esphome/components/nfc/nfc_tag.h index 0ded4cd6ee..6cc1a00c62 100644 --- a/esphome/components/nfc/nfc_tag.h +++ b/esphome/components/nfc/nfc_tag.h @@ -7,8 +7,7 @@ #include "esphome/core/log.h" #include "ndef_message.h" -namespace esphome { -namespace nfc { +namespace esphome::nfc { // NFC UIDs are 4, 7, or 10 bytes depending on tag type static constexpr size_t NFC_UID_MAX_LENGTH = 10; @@ -54,5 +53,4 @@ class NfcTag { std::shared_ptr ndef_message_; }; -} // namespace nfc -} // namespace esphome +} // namespace esphome::nfc diff --git a/esphome/components/noblex/noblex.cpp b/esphome/components/noblex/noblex.cpp index e7e421d177..ac8d2641fe 100644 --- a/esphome/components/noblex/noblex.cpp +++ b/esphome/components/noblex/noblex.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace noblex { +namespace esphome::noblex { static const char *const TAG = "noblex.climate"; @@ -299,5 +298,4 @@ bool NoblexClimate::on_receive(remote_base::RemoteReceiveData data) { return true; } // end on_receive() -} // namespace noblex -} // namespace esphome +} // namespace esphome::noblex diff --git a/esphome/components/noblex/noblex.h b/esphome/components/noblex/noblex.h index 3d52a1a538..62070e5dee 100644 --- a/esphome/components/noblex/noblex.h +++ b/esphome/components/noblex/noblex.h @@ -2,8 +2,7 @@ #include "esphome/components/climate_ir/climate_ir.h" -namespace esphome { -namespace noblex { +namespace esphome::noblex { // Temperature const uint8_t NOBLEX_TEMP_MIN = 16; // Celsius @@ -45,5 +44,4 @@ class NoblexClimate : public climate_ir::ClimateIR { uint8_t remote_state_[8]{}; }; -} // namespace noblex -} // namespace esphome +} // namespace esphome::noblex diff --git a/esphome/components/npi19/npi19.cpp b/esphome/components/npi19/npi19.cpp index 995abdff37..207acc9d99 100644 --- a/esphome/components/npi19/npi19.cpp +++ b/esphome/components/npi19/npi19.cpp @@ -3,8 +3,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace npi19 { +namespace esphome::npi19 { static const char *const TAG = "npi19"; @@ -101,5 +100,4 @@ void NPI19Component::update() { this->status_clear_warning(); } -} // namespace npi19 -} // namespace esphome +} // namespace esphome::npi19 diff --git a/esphome/components/npi19/npi19.h b/esphome/components/npi19/npi19.h index 8e6a8e3bfa..d1f74141ac 100644 --- a/esphome/components/npi19/npi19.h +++ b/esphome/components/npi19/npi19.h @@ -4,8 +4,7 @@ #include "esphome/components/sensor/sensor.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace npi19 { +namespace esphome::npi19 { /// This class implements support for the npi19 pressure and temperature i2c sensors. class NPI19Component : public PollingComponent, public i2c::I2CDevice { @@ -25,5 +24,4 @@ class NPI19Component : public PollingComponent, public i2c::I2CDevice { sensor::Sensor *raw_pressure_sensor_{nullptr}; }; -} // namespace npi19 -} // namespace esphome +} // namespace esphome::npi19 diff --git a/esphome/components/ntc/ntc.cpp b/esphome/components/ntc/ntc.cpp index e2097bdd77..49a42e858e 100644 --- a/esphome/components/ntc/ntc.cpp +++ b/esphome/components/ntc/ntc.cpp @@ -1,8 +1,7 @@ #include "ntc.h" #include "esphome/core/log.h" -namespace esphome { -namespace ntc { +namespace esphome::ntc { static const char *const TAG = "ntc"; @@ -26,5 +25,4 @@ void NTC::process_(float value) { this->publish_state(temp); } -} // namespace ntc -} // namespace esphome +} // namespace esphome::ntc diff --git a/esphome/components/ntc/ntc.h b/esphome/components/ntc/ntc.h index a0c72340de..466d03f789 100644 --- a/esphome/components/ntc/ntc.h +++ b/esphome/components/ntc/ntc.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "esphome/components/sensor/sensor.h" -namespace esphome { -namespace ntc { +namespace esphome::ntc { class NTC : public Component, public sensor::Sensor { public: @@ -24,5 +23,4 @@ class NTC : public Component, public sensor::Sensor { double c_; }; -} // namespace ntc -} // namespace esphome +} // namespace esphome::ntc diff --git a/esphome/components/one_wire/one_wire.cpp b/esphome/components/one_wire/one_wire.cpp index d14c1c92bd..aeab821f6a 100644 --- a/esphome/components/one_wire/one_wire.cpp +++ b/esphome/components/one_wire/one_wire.cpp @@ -1,7 +1,6 @@ #include "one_wire.h" -namespace esphome { -namespace one_wire { +namespace esphome::one_wire { static const char *const TAG = "one_wire"; @@ -51,5 +50,4 @@ bool OneWireDevice::check_address_or_index_() { return true; } -} // namespace one_wire -} // namespace esphome +} // namespace esphome::one_wire diff --git a/esphome/components/one_wire/one_wire.h b/esphome/components/one_wire/one_wire.h index 324e46cd55..4dbbe11792 100644 --- a/esphome/components/one_wire/one_wire.h +++ b/esphome/components/one_wire/one_wire.h @@ -4,8 +4,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace one_wire { +namespace esphome::one_wire { #define LOG_ONE_WIRE_DEVICE(this) \ ESP_LOGCONFIG(TAG, " Address: %s (%s)", this->get_address_name().c_str(), \ @@ -43,5 +42,4 @@ class OneWireDevice { bool send_command_(uint8_t cmd); }; -} // namespace one_wire -} // namespace esphome +} // namespace esphome::one_wire diff --git a/esphome/components/one_wire/one_wire_bus.cpp b/esphome/components/one_wire/one_wire_bus.cpp index 99e1f352fb..c7ea59050c 100644 --- a/esphome/components/one_wire/one_wire_bus.cpp +++ b/esphome/components/one_wire/one_wire_bus.cpp @@ -1,8 +1,7 @@ #include "one_wire_bus.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace one_wire { +namespace esphome::one_wire { static const char *const TAG = "one_wire"; @@ -93,5 +92,4 @@ void OneWireBus::dump_devices_(const char *tag) { } } -} // namespace one_wire -} // namespace esphome +} // namespace esphome::one_wire diff --git a/esphome/components/one_wire/one_wire_bus.h b/esphome/components/one_wire/one_wire_bus.h index 6302fcee7b..00f5a6462e 100644 --- a/esphome/components/one_wire/one_wire_bus.h +++ b/esphome/components/one_wire/one_wire_bus.h @@ -4,8 +4,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace one_wire { +namespace esphome::one_wire { class OneWireBus { public: @@ -64,5 +63,4 @@ class OneWireBus { virtual uint64_t search_int() = 0; }; -} // namespace one_wire -} // namespace esphome +} // namespace esphome::one_wire diff --git a/esphome/components/opentherm/automation.h b/esphome/components/opentherm/automation.h index acbe33ac8f..aa20a4ec5a 100644 --- a/esphome/components/opentherm/automation.h +++ b/esphome/components/opentherm/automation.h @@ -4,8 +4,7 @@ #include "hub.h" #include "opentherm.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { class BeforeSendTrigger : public Trigger { public: @@ -21,5 +20,4 @@ class BeforeProcessResponseTrigger : public Trigger { } }; -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/hub.cpp b/esphome/components/opentherm/hub.cpp index 7a0cdc7f80..e2828a9e30 100644 --- a/esphome/components/opentherm/hub.cpp +++ b/esphome/components/opentherm/hub.cpp @@ -3,8 +3,7 @@ #include -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { static const char *const TAG = "opentherm"; namespace message_data { @@ -419,5 +418,4 @@ void OpenthermHub::dump_config() { } } -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/hub.h b/esphome/components/opentherm/hub.h index 960e23d6dd..2638137668 100644 --- a/esphome/components/opentherm/hub.h +++ b/esphome/components/opentherm/hub.h @@ -35,8 +35,7 @@ #include "opentherm_macros.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { static const uint8_t REPEATING_MESSAGE_ORDER = 255; static const uint8_t INITIAL_UNORDERED_MESSAGE_ORDER = 254; @@ -175,5 +174,4 @@ class OpenthermHub : public Component { void dump_config() override; }; -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/input.h b/esphome/components/opentherm/input.h index 3567138792..f196d49037 100644 --- a/esphome/components/opentherm/input.h +++ b/esphome/components/opentherm/input.h @@ -1,7 +1,6 @@ #pragma once -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { class OpenthermInput { public: @@ -14,5 +13,4 @@ class OpenthermInput { virtual void set_auto_max_value(bool auto_max_value) { this->auto_max_value = auto_max_value; } }; -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/number/opentherm_number.cpp b/esphome/components/opentherm/number/opentherm_number.cpp index bdb02a605c..d78c6eb38a 100644 --- a/esphome/components/opentherm/number/opentherm_number.cpp +++ b/esphome/components/opentherm/number/opentherm_number.cpp @@ -1,7 +1,6 @@ #include "opentherm_number.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { static const char *const TAG = "opentherm.number"; @@ -38,5 +37,4 @@ void OpenthermNumber::dump_config() { this->restore_value_, this->initial_value_, this->state); } -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/number/opentherm_number.h b/esphome/components/opentherm/number/opentherm_number.h index 6f86072754..c110bed2eb 100644 --- a/esphome/components/opentherm/number/opentherm_number.h +++ b/esphome/components/opentherm/number/opentherm_number.h @@ -5,8 +5,7 @@ #include "esphome/core/log.h" #include "esphome/components/opentherm/input.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { // Just a simple number, which stores the number class OpenthermNumber : public number::Number, public Component, public OpenthermInput { @@ -27,5 +26,4 @@ class OpenthermNumber : public number::Number, public Component, public Openther void set_restore_value(bool restore_value) { this->restore_value_ = restore_value; } }; -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/opentherm.cpp b/esphome/components/opentherm/opentherm.cpp index 97cf83a5aa..1ee4c9191b 100644 --- a/esphome/components/opentherm/opentherm.cpp +++ b/esphome/components/opentherm/opentherm.cpp @@ -16,8 +16,7 @@ #endif #include -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { using std::string; @@ -566,5 +565,4 @@ void OpenthermData::s16(int16_t value) { this->valueHB = (value >> 8) & 0xFF; } -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/opentherm.h b/esphome/components/opentherm/opentherm.h index eb8c5b3ad6..3078e92c9d 100644 --- a/esphome/components/opentherm/opentherm.h +++ b/esphome/components/opentherm/opentherm.h @@ -16,8 +16,7 @@ #include "driver/gptimer.h" #endif -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { template constexpr T read_bit(T value, uint8_t bit) { return (value >> bit) & 0x01; } @@ -403,5 +402,4 @@ class OpenTherm { #endif }; -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/opentherm_macros.h b/esphome/components/opentherm/opentherm_macros.h index 398c64aa8f..c5ed02a50b 100644 --- a/esphome/components/opentherm/opentherm_macros.h +++ b/esphome/components/opentherm/opentherm_macros.h @@ -1,6 +1,6 @@ #pragma once -namespace esphome { -namespace opentherm { + +namespace esphome::opentherm { // ===== hub.h macros ===== @@ -158,5 +158,4 @@ namespace opentherm { #define SHOW_INNER(x) #x #define SHOW(x) SHOW_INNER(x) -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/output/opentherm_output.cpp b/esphome/components/opentherm/output/opentherm_output.cpp index ff82ddd72c..2735c85d06 100644 --- a/esphome/components/opentherm/output/opentherm_output.cpp +++ b/esphome/components/opentherm/output/opentherm_output.cpp @@ -1,8 +1,7 @@ #include "esphome/core/helpers.h" // for clamp() and lerp() #include "opentherm_output.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { static const char *const TAG = "opentherm.output"; @@ -14,5 +13,4 @@ void opentherm::OpenthermOutput::write_state(float state) { this->has_state_ = true; ESP_LOGD(TAG, "Output %s set to %.2f", this->id_, this->state); } -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/output/opentherm_output.h b/esphome/components/opentherm/output/opentherm_output.h index 8d6a0ee4ba..e789d72702 100644 --- a/esphome/components/opentherm/output/opentherm_output.h +++ b/esphome/components/opentherm/output/opentherm_output.h @@ -4,8 +4,7 @@ #include "esphome/components/opentherm/input.h" #include "esphome/core/log.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { class OpenthermOutput : public output::FloatOutput, public Component, public OpenthermInput { protected: @@ -29,5 +28,4 @@ class OpenthermOutput : public output::FloatOutput, public Component, public Ope float get_max_value() { return this->max_value_; } }; -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/switch/opentherm_switch.cpp b/esphome/components/opentherm/switch/opentherm_switch.cpp index 5c5d62e68e..2fc99e793e 100644 --- a/esphome/components/opentherm/switch/opentherm_switch.cpp +++ b/esphome/components/opentherm/switch/opentherm_switch.cpp @@ -1,7 +1,6 @@ #include "opentherm_switch.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { static const char *const TAG = "opentherm.switch"; @@ -24,5 +23,4 @@ void OpenthermSwitch::dump_config() { ESP_LOGCONFIG(TAG, " Current state: %d", this->state); } -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opentherm/switch/opentherm_switch.h b/esphome/components/opentherm/switch/opentherm_switch.h index 0c20a0d9ed..ca930d4f7c 100644 --- a/esphome/components/opentherm/switch/opentherm_switch.h +++ b/esphome/components/opentherm/switch/opentherm_switch.h @@ -4,8 +4,7 @@ #include "esphome/components/switch/switch.h" #include "esphome/core/log.h" -namespace esphome { -namespace opentherm { +namespace esphome::opentherm { class OpenthermSwitch : public switch_::Switch, public Component { protected: @@ -16,5 +15,4 @@ class OpenthermSwitch : public switch_::Switch, public Component { void dump_config() override; }; -} // namespace opentherm -} // namespace esphome +} // namespace esphome::opentherm diff --git a/esphome/components/opt3001/opt3001.cpp b/esphome/components/opt3001/opt3001.cpp index a942e45035..ce5fbdfd82 100644 --- a/esphome/components/opt3001/opt3001.cpp +++ b/esphome/components/opt3001/opt3001.cpp @@ -1,8 +1,7 @@ #include "opt3001.h" #include "esphome/core/log.h" -namespace esphome { -namespace opt3001 { +namespace esphome::opt3001 { static const char *const TAG = "opt3001.sensor"; @@ -116,5 +115,4 @@ void OPT3001Sensor::update() { }); } -} // namespace opt3001 -} // namespace esphome +} // namespace esphome::opt3001 diff --git a/esphome/components/opt3001/opt3001.h b/esphome/components/opt3001/opt3001.h index 3bce9f0aeb..e5de536353 100644 --- a/esphome/components/opt3001/opt3001.h +++ b/esphome/components/opt3001/opt3001.h @@ -4,8 +4,7 @@ #include "esphome/components/sensor/sensor.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace opt3001 { +namespace esphome::opt3001 { /// This class implements support for the i2c-based OPT3001 ambient light sensor. class OPT3001Sensor : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice { @@ -22,5 +21,4 @@ class OPT3001Sensor : public sensor::Sensor, public PollingComponent, public i2c bool updating_{false}; }; -} // namespace opt3001 -} // namespace esphome +} // namespace esphome::opt3001 diff --git a/esphome/components/output/automation.cpp b/esphome/components/output/automation.cpp index 5533a6bee4..610da897d9 100644 --- a/esphome/components/output/automation.cpp +++ b/esphome/components/output/automation.cpp @@ -1,10 +1,8 @@ #include "automation.h" #include "esphome/core/log.h" -namespace esphome { -namespace output { +namespace esphome::output { static const char *const TAG = "output.automation"; -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/automation.h b/esphome/components/output/automation.h index 537226a143..301f568388 100644 --- a/esphome/components/output/automation.h +++ b/esphome/components/output/automation.h @@ -6,8 +6,7 @@ #include "esphome/components/output/binary_output.h" #include "esphome/components/output/float_output.h" -namespace esphome { -namespace output { +namespace esphome::output { template class TurnOffAction : public Action { public: @@ -67,5 +66,4 @@ template class SetMaxPowerAction : public Action { }; #endif // USE_OUTPUT_FLOAT_POWER_SCALING -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/binary_output.h b/esphome/components/output/binary_output.h index 7a15bc7b51..74ca3ad594 100644 --- a/esphome/components/output/binary_output.h +++ b/esphome/components/output/binary_output.h @@ -7,8 +7,7 @@ #include "esphome/components/power_supply/power_supply.h" #endif -namespace esphome { -namespace output { +namespace esphome::output { #define LOG_BINARY_OUTPUT(this) \ if (this->inverted_) { \ @@ -69,5 +68,4 @@ class BinaryOutput { #endif }; -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/button/output_button.cpp b/esphome/components/output/button/output_button.cpp index 4dd7ec249b..5833743586 100644 --- a/esphome/components/output/button/output_button.cpp +++ b/esphome/components/output/button/output_button.cpp @@ -1,8 +1,7 @@ #include "output_button.h" #include "esphome/core/log.h" -namespace esphome { -namespace output { +namespace esphome::output { static const char *const TAG = "output.button"; @@ -17,5 +16,4 @@ void OutputButton::press_action() { this->set_timeout("reset", this->duration_, [this]() { this->output_->turn_off(); }); } -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/button/output_button.h b/esphome/components/output/button/output_button.h index 8802c9754d..1a2997bdcf 100644 --- a/esphome/components/output/button/output_button.h +++ b/esphome/components/output/button/output_button.h @@ -4,8 +4,7 @@ #include "esphome/components/button/button.h" #include "esphome/components/output/binary_output.h" -namespace esphome { -namespace output { +namespace esphome::output { class OutputButton : public button::Button, public Component { public: @@ -21,5 +20,4 @@ class OutputButton : public button::Button, public Component { uint32_t duration_; }; -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/float_output.cpp b/esphome/components/output/float_output.cpp index 35629c828a..e2b029f368 100644 --- a/esphome/components/output/float_output.cpp +++ b/esphome/components/output/float_output.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace output { +namespace esphome::output { static const char *const TAG = "output.float"; @@ -40,5 +39,4 @@ void FloatOutput::set_level(float state) { void FloatOutput::write_state(bool state) { this->set_level(state != this->inverted_ ? 1.0f : 0.0f); } -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/float_output.h b/esphome/components/output/float_output.h index 3e1bd83968..673f423572 100644 --- a/esphome/components/output/float_output.h +++ b/esphome/components/output/float_output.h @@ -4,8 +4,7 @@ #include "esphome/core/defines.h" #include "binary_output.h" -namespace esphome { -namespace output { +namespace esphome::output { #ifdef USE_OUTPUT_FLOAT_POWER_SCALING #define LOG_FLOAT_OUTPUT(this) \ @@ -130,5 +129,4 @@ class FloatOutput : public BinaryOutput { #endif }; -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/lock/output_lock.cpp b/esphome/components/output/lock/output_lock.cpp index c373cd7b7c..ee9d918542 100644 --- a/esphome/components/output/lock/output_lock.cpp +++ b/esphome/components/output/lock/output_lock.cpp @@ -1,8 +1,7 @@ #include "output_lock.h" #include "esphome/core/log.h" -namespace esphome { -namespace output { +namespace esphome::output { static const char *const TAG = "output.lock"; @@ -21,5 +20,4 @@ void OutputLock::control(const lock::LockCall &call) { this->publish_state(state); } -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/lock/output_lock.h b/esphome/components/output/lock/output_lock.h index c183c3a3ea..7be96e1e82 100644 --- a/esphome/components/output/lock/output_lock.h +++ b/esphome/components/output/lock/output_lock.h @@ -4,8 +4,7 @@ #include "esphome/components/lock/lock.h" #include "esphome/components/output/binary_output.h" -namespace esphome { -namespace output { +namespace esphome::output { class OutputLock : public lock::Lock, public Component { public: @@ -20,5 +19,4 @@ class OutputLock : public lock::Lock, public Component { output::BinaryOutput *output_; }; -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/switch/output_switch.cpp b/esphome/components/output/switch/output_switch.cpp index 54260ba37a..7cee2a8639 100644 --- a/esphome/components/output/switch/output_switch.cpp +++ b/esphome/components/output/switch/output_switch.cpp @@ -1,8 +1,7 @@ #include "output_switch.h" #include "esphome/core/log.h" -namespace esphome { -namespace output { +namespace esphome::output { static const char *const TAG = "output.switch"; @@ -25,5 +24,4 @@ void OutputSwitch::write_state(bool state) { this->publish_state(state); } -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/output/switch/output_switch.h b/esphome/components/output/switch/output_switch.h index a184a342fe..b0d85678be 100644 --- a/esphome/components/output/switch/output_switch.h +++ b/esphome/components/output/switch/output_switch.h @@ -4,8 +4,7 @@ #include "esphome/components/switch/switch.h" #include "esphome/components/output/binary_output.h" -namespace esphome { -namespace output { +namespace esphome::output { class OutputSwitch : public switch_::Switch, public Component { public: @@ -21,5 +20,4 @@ class OutputSwitch : public switch_::Switch, public Component { output::BinaryOutput *output_; }; -} // namespace output -} // namespace esphome +} // namespace esphome::output diff --git a/esphome/components/packet_transport/packet_transport.cpp b/esphome/components/packet_transport/packet_transport.cpp index a2199977aa..a21f0e2f63 100644 --- a/esphome/components/packet_transport/packet_transport.cpp +++ b/esphome/components/packet_transport/packet_transport.cpp @@ -7,8 +7,7 @@ #include "esphome/components/xxtea/xxtea.h" -namespace esphome { -namespace packet_transport { +namespace esphome::packet_transport { // Maximum bytes to log in hex output (168 * 3 = 504, under TX buffer size of 512) static constexpr size_t PACKET_MAX_LOG_BYTES = 168; @@ -609,5 +608,4 @@ void PacketTransport::send_ping_pong_request_() { this->resend_ping_key_ = false; ESP_LOGV(TAG, "Sent new ping request %08X", (unsigned) this->ping_key_); } -} // namespace packet_transport -} // namespace esphome +} // namespace esphome::packet_transport diff --git a/esphome/components/packet_transport/packet_transport.h b/esphome/components/packet_transport/packet_transport.h index 836775bc85..3938054c15 100644 --- a/esphome/components/packet_transport/packet_transport.h +++ b/esphome/components/packet_transport/packet_transport.h @@ -22,8 +22,7 @@ * On receipt of a data packet, it should call `this->process_()` with the data. */ -namespace esphome { -namespace packet_transport { +namespace esphome::packet_transport { // std::less provides allocation-free comparison with const char * template using string_map_t = std::map>; @@ -168,5 +167,4 @@ class PacketTransport : public PollingComponent { bool is_encrypted_() const { return !this->encryption_key_.empty(); } }; -} // namespace packet_transport -} // namespace esphome +} // namespace esphome::packet_transport diff --git a/esphome/components/partition/light_partition.cpp b/esphome/components/partition/light_partition.cpp index 63c0d0186e..2755f82294 100644 --- a/esphome/components/partition/light_partition.cpp +++ b/esphome/components/partition/light_partition.cpp @@ -1,10 +1,8 @@ #include "light_partition.h" #include "esphome/core/log.h" -namespace esphome { -namespace partition { +namespace esphome::partition { static const char *const TAG = "partition.light"; -} // namespace partition -} // namespace esphome +} // namespace esphome::partition diff --git a/esphome/components/partition/light_partition.h b/esphome/components/partition/light_partition.h index bd90b4c4f1..7a2f3678c1 100644 --- a/esphome/components/partition/light_partition.h +++ b/esphome/components/partition/light_partition.h @@ -6,8 +6,7 @@ #include "esphome/core/component.h" #include "esphome/components/light/addressable_light.h" -namespace esphome { -namespace partition { +namespace esphome::partition { class AddressableSegment { public: @@ -93,5 +92,4 @@ class PartitionLightOutput : public light::AddressableLight { std::vector segments_; }; -} // namespace partition -} // namespace esphome +} // namespace esphome::partition diff --git a/esphome/components/pca6416a/pca6416a.cpp b/esphome/components/pca6416a/pca6416a.cpp index d617336e7e..4c19feab6e 100644 --- a/esphome/components/pca6416a/pca6416a.cpp +++ b/esphome/components/pca6416a/pca6416a.cpp @@ -1,8 +1,7 @@ #include "pca6416a.h" #include "esphome/core/log.h" -namespace esphome { -namespace pca6416a { +namespace esphome::pca6416a { enum PCA6416AGPIORegisters { // 0 side @@ -205,5 +204,4 @@ size_t PCA6416AGPIOPin::dump_summary(char *buffer, size_t len) const { return buf_append_printf(buffer, len, 0, "%u via PCA6416A", this->pin_); } -} // namespace pca6416a -} // namespace esphome +} // namespace esphome::pca6416a diff --git a/esphome/components/pca6416a/pca6416a.h b/esphome/components/pca6416a/pca6416a.h index 4d2e6b219e..3170033b28 100644 --- a/esphome/components/pca6416a/pca6416a.h +++ b/esphome/components/pca6416a/pca6416a.h @@ -5,8 +5,7 @@ #include "esphome/components/i2c/i2c.h" #include "esphome/components/gpio_expander/cached_gpio.h" -namespace esphome { -namespace pca6416a { +namespace esphome::pca6416a { class PCA6416AComponent : public Component, public i2c::I2CDevice, @@ -72,5 +71,4 @@ class PCA6416AGPIOPin : public GPIOPin { gpio::Flags flags_; }; -} // namespace pca6416a -} // namespace esphome +} // namespace esphome::pca6416a diff --git a/esphome/components/pca9554/pca9554.cpp b/esphome/components/pca9554/pca9554.cpp index 393bbfd61e..c3ea6a3c0c 100644 --- a/esphome/components/pca9554/pca9554.cpp +++ b/esphome/components/pca9554/pca9554.cpp @@ -1,8 +1,7 @@ #include "pca9554.h" #include "esphome/core/log.h" -namespace esphome { -namespace pca9554 { +namespace esphome::pca9554 { // for 16 bit expanders, these addresses will be doubled. const uint8_t INPUT_REG = 0; @@ -152,5 +151,4 @@ size_t PCA9554GPIOPin::dump_summary(char *buffer, size_t len) const { return buf_append_printf(buffer, len, 0, "%u via PCA9554", this->pin_); } -} // namespace pca9554 -} // namespace esphome +} // namespace esphome::pca9554 diff --git a/esphome/components/pca9554/pca9554.h b/esphome/components/pca9554/pca9554.h index f33f9d4592..9fa398cf29 100644 --- a/esphome/components/pca9554/pca9554.h +++ b/esphome/components/pca9554/pca9554.h @@ -5,8 +5,7 @@ #include "esphome/components/i2c/i2c.h" #include "esphome/components/gpio_expander/cached_gpio.h" -namespace esphome { -namespace pca9554 { +namespace esphome::pca9554 { class PCA9554Component : public Component, public i2c::I2CDevice, @@ -76,5 +75,4 @@ class PCA9554GPIOPin : public GPIOPin { gpio::Flags flags_; }; -} // namespace pca9554 -} // namespace esphome +} // namespace esphome::pca9554 diff --git a/esphome/components/pca9685/pca9685_output.cpp b/esphome/components/pca9685/pca9685_output.cpp index 89a6bcdcc0..533b3391b1 100644 --- a/esphome/components/pca9685/pca9685_output.cpp +++ b/esphome/components/pca9685/pca9685_output.cpp @@ -3,8 +3,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pca9685 { +namespace esphome::pca9685 { static const char *const TAG = "pca9685"; @@ -160,5 +159,4 @@ void PCA9685Channel::write_state(float state) { this->parent_->set_channel_value_(this->channel_, duty); } -} // namespace pca9685 -} // namespace esphome +} // namespace esphome::pca9685 diff --git a/esphome/components/pca9685/pca9685_output.h b/esphome/components/pca9685/pca9685_output.h index 785cc974da..33819f23ee 100644 --- a/esphome/components/pca9685/pca9685_output.h +++ b/esphome/components/pca9685/pca9685_output.h @@ -4,8 +4,7 @@ #include "esphome/components/output/float_output.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace pca9685 { +namespace esphome::pca9685 { enum class PhaseBalancer { NONE = 0x00, @@ -76,5 +75,4 @@ class PCA9685Output : public Component, public i2c::I2CDevice { bool update_{true}; }; -} // namespace pca9685 -} // namespace esphome +} // namespace esphome::pca9685 diff --git a/esphome/components/pcd8544/pcd_8544.cpp b/esphome/components/pcd8544/pcd_8544.cpp index 95d91ff18a..c80283ffc9 100644 --- a/esphome/components/pcd8544/pcd_8544.cpp +++ b/esphome/components/pcd8544/pcd_8544.cpp @@ -3,8 +3,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pcd8544 { +namespace esphome::pcd8544 { static const char *const TAG = "pcd_8544"; @@ -128,5 +127,4 @@ void PCD8544::fill(Color color) { this->buffer_[i] = fill; } -} // namespace pcd8544 -} // namespace esphome +} // namespace esphome::pcd8544 diff --git a/esphome/components/pcd8544/pcd_8544.h b/esphome/components/pcd8544/pcd_8544.h index cfdb96de61..9e4ee93035 100644 --- a/esphome/components/pcd8544/pcd_8544.h +++ b/esphome/components/pcd8544/pcd_8544.h @@ -4,8 +4,7 @@ #include "esphome/components/spi/spi.h" #include "esphome/components/display/display_buffer.h" -namespace esphome { -namespace pcd8544 { +namespace esphome::pcd8544 { class PCD8544 : public display::DisplayBuffer, public spi::SPIDevice class ReadAction : public Action, public Parente public: void play(const Ts &...x) override { this->parent_->read_time(); } }; -} // namespace pcf85063 -} // namespace esphome +} // namespace esphome::pcf85063 diff --git a/esphome/components/pcf8563/pcf8563.cpp b/esphome/components/pcf8563/pcf8563.cpp index 50003ca378..93c0f2bdf2 100644 --- a/esphome/components/pcf8563/pcf8563.cpp +++ b/esphome/components/pcf8563/pcf8563.cpp @@ -4,8 +4,7 @@ // Datasheet: // - https://nl.mouser.com/datasheet/2/302/PCF8563-1127619.pdf -namespace esphome { -namespace pcf8563 { +namespace esphome::pcf8563 { static const char *const TAG = "PCF8563"; @@ -99,5 +98,4 @@ bool PCF8563Component::write_rtc_() { pcf8563_.reg.day, ONOFF(!pcf8563_.reg.stop), pcf8563_.reg.clkout_enabled); return true; } -} // namespace pcf8563 -} // namespace esphome +} // namespace esphome::pcf8563 diff --git a/esphome/components/pcf8563/pcf8563.h b/esphome/components/pcf8563/pcf8563.h index cd37d05816..72b600d9ba 100644 --- a/esphome/components/pcf8563/pcf8563.h +++ b/esphome/components/pcf8563/pcf8563.h @@ -4,8 +4,7 @@ #include "esphome/components/i2c/i2c.h" #include "esphome/components/time/real_time_clock.h" -namespace esphome { -namespace pcf8563 { +namespace esphome::pcf8563 { class PCF8563Component : public time::RealTimeClock, public i2c::I2CDevice { public: @@ -119,5 +118,4 @@ template class ReadAction : public Action, public Parente public: void play(const Ts &...x) override { this->parent_->read_time(); } }; -} // namespace pcf8563 -} // namespace esphome +} // namespace esphome::pcf8563 diff --git a/esphome/components/pcf8574/pcf8574.cpp b/esphome/components/pcf8574/pcf8574.cpp index 8fe8526797..2e054b0683 100644 --- a/esphome/components/pcf8574/pcf8574.cpp +++ b/esphome/components/pcf8574/pcf8574.cpp @@ -1,8 +1,7 @@ #include "pcf8574.h" #include "esphome/core/log.h" -namespace esphome { -namespace pcf8574 { +namespace esphome::pcf8574 { static const char *const TAG = "pcf8574"; @@ -131,5 +130,4 @@ size_t PCF8574GPIOPin::dump_summary(char *buffer, size_t len) const { return buf_append_printf(buffer, len, 0, "%u via PCF8574", this->pin_); } -} // namespace pcf8574 -} // namespace esphome +} // namespace esphome::pcf8574 diff --git a/esphome/components/pcf8574/pcf8574.h b/esphome/components/pcf8574/pcf8574.h index cae2e930b7..ece472c4bb 100644 --- a/esphome/components/pcf8574/pcf8574.h +++ b/esphome/components/pcf8574/pcf8574.h @@ -5,8 +5,7 @@ #include "esphome/components/i2c/i2c.h" #include "esphome/components/gpio_expander/cached_gpio.h" -namespace esphome { -namespace pcf8574 { +namespace esphome::pcf8574 { // PCF8574(8 pins)/PCF8575(16 pins) always read/write all pins in a single I2C transaction // so we use uint16_t as bank type to ensure all pins are in one bank and cached together @@ -72,5 +71,4 @@ class PCF8574GPIOPin : public GPIOPin { gpio::Flags flags_; }; -} // namespace pcf8574 -} // namespace esphome +} // namespace esphome::pcf8574 diff --git a/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp b/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp index 00f29983be..e8e9530dba 100644 --- a/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp +++ b/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp @@ -1,8 +1,7 @@ #include "pi4ioe5v6408.h" #include "esphome/core/log.h" -namespace esphome { -namespace pi4ioe5v6408 { +namespace esphome::pi4ioe5v6408 { static const uint8_t PI4IOE5V6408_REGISTER_DEVICE_ID = 0x01; static const uint8_t PI4IOE5V6408_REGISTER_IO_DIR = 0x03; @@ -204,5 +203,4 @@ size_t PI4IOE5V6408GPIOPin::dump_summary(char *buffer, size_t len) const { return buf_append_printf(buffer, len, 0, "%u via PI4IOE5V6408", this->pin_); } -} // namespace pi4ioe5v6408 -} // namespace esphome +} // namespace esphome::pi4ioe5v6408 diff --git a/esphome/components/pi4ioe5v6408/pi4ioe5v6408.h b/esphome/components/pi4ioe5v6408/pi4ioe5v6408.h index ff2474fe99..6225956430 100644 --- a/esphome/components/pi4ioe5v6408/pi4ioe5v6408.h +++ b/esphome/components/pi4ioe5v6408/pi4ioe5v6408.h @@ -5,8 +5,7 @@ #include "esphome/core/component.h" #include "esphome/core/hal.h" -namespace esphome { -namespace pi4ioe5v6408 { +namespace esphome::pi4ioe5v6408 { class PI4IOE5V6408Component : public Component, public i2c::I2CDevice, public gpio_expander::CachedGpioExpander { @@ -70,5 +69,4 @@ class PI4IOE5V6408GPIOPin : public GPIOPin, public Parented -namespace esphome { -namespace pid { +namespace esphome::pid { class PIDAutotuner { public: @@ -110,5 +109,4 @@ class PIDAutotuner { std::string id_; }; -} // namespace pid -} // namespace esphome +} // namespace esphome::pid diff --git a/esphome/components/pid/pid_climate.cpp b/esphome/components/pid/pid_climate.cpp index 54b7a688b4..8c9231fda6 100644 --- a/esphome/components/pid/pid_climate.cpp +++ b/esphome/components/pid/pid_climate.cpp @@ -1,8 +1,7 @@ #include "pid_climate.h" #include "esphome/core/log.h" -namespace esphome { -namespace pid { +namespace esphome::pid { static const char *const TAG = "pid.climate"; @@ -186,5 +185,4 @@ void PIDClimate::start_autotune(std::unique_ptr &&autotune) { void PIDClimate::reset_integral_term() { this->controller_.reset_accumulated_integral(); } -} // namespace pid -} // namespace esphome +} // namespace esphome::pid diff --git a/esphome/components/pid/pid_climate.h b/esphome/components/pid/pid_climate.h index 479a0e48ee..9e3c89ca4d 100644 --- a/esphome/components/pid/pid_climate.h +++ b/esphome/components/pid/pid_climate.h @@ -9,8 +9,7 @@ #include "pid_controller.h" #include "pid_autotuner.h" -namespace esphome { -namespace pid { +namespace esphome::pid { class PIDClimate : public climate::Climate, public Component { public: @@ -164,5 +163,4 @@ template class PIDSetControlParametersAction : public Action -namespace esphome { -namespace pid { +namespace esphome::pid { struct PIDController { float update(float setpoint, float process_value); @@ -71,5 +70,4 @@ struct PIDController { FixedRingBuffer output_window_; }; // Struct PIDController -} // namespace pid -} // namespace esphome +} // namespace esphome::pid diff --git a/esphome/components/pid/sensor/pid_climate_sensor.cpp b/esphome/components/pid/sensor/pid_climate_sensor.cpp index 41ca027d8d..4e963168e6 100644 --- a/esphome/components/pid/sensor/pid_climate_sensor.cpp +++ b/esphome/components/pid/sensor/pid_climate_sensor.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pid { +namespace esphome::pid { static const char *const TAG = "pid.sensor"; @@ -55,5 +54,4 @@ void PIDClimateSensor::update_from_parent_() { } void PIDClimateSensor::dump_config() { LOG_SENSOR("", "PID Climate Sensor", this); } -} // namespace pid -} // namespace esphome +} // namespace esphome::pid diff --git a/esphome/components/pid/sensor/pid_climate_sensor.h b/esphome/components/pid/sensor/pid_climate_sensor.h index f3774610f8..d6bdc66a46 100644 --- a/esphome/components/pid/sensor/pid_climate_sensor.h +++ b/esphome/components/pid/sensor/pid_climate_sensor.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "esphome/components/pid/pid_climate.h" -namespace esphome { -namespace pid { +namespace esphome::pid { enum PIDClimateSensorType { PID_SENSOR_TYPE_RESULT, @@ -33,5 +32,4 @@ class PIDClimateSensor : public sensor::Sensor, public Component { PIDClimateSensorType type_; }; -} // namespace pid -} // namespace esphome +} // namespace esphome::pid diff --git a/esphome/components/pipsolar/output/pipsolar_output.cpp b/esphome/components/pipsolar/output/pipsolar_output.cpp index 60f6342759..1af753fce3 100644 --- a/esphome/components/pipsolar/output/pipsolar_output.cpp +++ b/esphome/components/pipsolar/output/pipsolar_output.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pipsolar { +namespace esphome::pipsolar { static const char *const TAG = "pipsolar.output"; @@ -18,5 +17,4 @@ void PipsolarOutput::write_state(float state) { ESP_LOGD(TAG, "Will not write: %s as it is not in list of allowed values", tmp); } } -} // namespace pipsolar -} // namespace esphome +} // namespace esphome::pipsolar diff --git a/esphome/components/pipsolar/output/pipsolar_output.h b/esphome/components/pipsolar/output/pipsolar_output.h index 66eda8e391..4a6e4c29d7 100644 --- a/esphome/components/pipsolar/output/pipsolar_output.h +++ b/esphome/components/pipsolar/output/pipsolar_output.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace pipsolar { +namespace esphome::pipsolar { class Pipsolar; @@ -40,5 +39,4 @@ template class SetOutputAction : public Action { PipsolarOutput *output_; }; -} // namespace pipsolar -} // namespace esphome +} // namespace esphome::pipsolar diff --git a/esphome/components/pipsolar/pipsolar.cpp b/esphome/components/pipsolar/pipsolar.cpp index 5123d8d9d3..bd5733fe74 100644 --- a/esphome/components/pipsolar/pipsolar.cpp +++ b/esphome/components/pipsolar/pipsolar.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pipsolar { +namespace esphome::pipsolar { static const char *const TAG = "pipsolar"; @@ -811,5 +810,4 @@ uint16_t Pipsolar::pipsolar_crc_(uint8_t *msg, uint8_t len) { return crc; } -} // namespace pipsolar -} // namespace esphome +} // namespace esphome::pipsolar diff --git a/esphome/components/pipsolar/pipsolar.h b/esphome/components/pipsolar/pipsolar.h index beae67a4e0..59332080cf 100644 --- a/esphome/components/pipsolar/pipsolar.h +++ b/esphome/components/pipsolar/pipsolar.h @@ -9,8 +9,7 @@ #include "esphome/core/component.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace pipsolar { +namespace esphome::pipsolar { enum ENUMPollingCommand { POLLING_QPIRI = 0, @@ -246,5 +245,4 @@ class Pipsolar : public uart::UARTDevice, public PollingComponent { PollingCommand enabled_polling_commands_[POLLING_COMMANDS_MAX]; }; -} // namespace pipsolar -} // namespace esphome +} // namespace esphome::pipsolar diff --git a/esphome/components/pipsolar/switch/pipsolar_switch.cpp b/esphome/components/pipsolar/switch/pipsolar_switch.cpp index 512587511b..1eedfed0fd 100644 --- a/esphome/components/pipsolar/switch/pipsolar_switch.cpp +++ b/esphome/components/pipsolar/switch/pipsolar_switch.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include "esphome/core/application.h" -namespace esphome { -namespace pipsolar { +namespace esphome::pipsolar { static const char *const TAG = "pipsolar.switch"; @@ -15,5 +14,4 @@ void PipsolarSwitch::write_state(bool state) { } } -} // namespace pipsolar -} // namespace esphome +} // namespace esphome::pipsolar diff --git a/esphome/components/pipsolar/switch/pipsolar_switch.h b/esphome/components/pipsolar/switch/pipsolar_switch.h index bb62d4794a..20d2640d90 100644 --- a/esphome/components/pipsolar/switch/pipsolar_switch.h +++ b/esphome/components/pipsolar/switch/pipsolar_switch.h @@ -4,8 +4,7 @@ #include "esphome/components/switch/switch.h" #include "esphome/core/component.h" -namespace esphome { -namespace pipsolar { +namespace esphome::pipsolar { class Pipsolar; class PipsolarSwitch : public switch_::Switch, public Component { public: @@ -24,5 +23,4 @@ class PipsolarSwitch : public switch_::Switch, public Component { Pipsolar *parent_; }; -} // namespace pipsolar -} // namespace esphome +} // namespace esphome::pipsolar diff --git a/esphome/components/pm1006/pm1006.cpp b/esphome/components/pm1006/pm1006.cpp index fe8890e777..6a325c57dc 100644 --- a/esphome/components/pm1006/pm1006.cpp +++ b/esphome/components/pm1006/pm1006.cpp @@ -1,8 +1,7 @@ #include "pm1006.h" #include "esphome/core/log.h" -namespace esphome { -namespace pm1006 { +namespace esphome::pm1006 { static const char *const TAG = "pm1006"; @@ -93,5 +92,4 @@ void PM1006Component::parse_data_() { } } -} // namespace pm1006 -} // namespace esphome +} // namespace esphome::pm1006 diff --git a/esphome/components/pm1006/pm1006.h b/esphome/components/pm1006/pm1006.h index 6b6332e1e3..38ab284f47 100644 --- a/esphome/components/pm1006/pm1006.h +++ b/esphome/components/pm1006/pm1006.h @@ -5,8 +5,7 @@ #include "esphome/components/sensor/sensor.h" #include "esphome/components/uart/uart.h" -namespace esphome { -namespace pm1006 { +namespace esphome::pm1006 { class PM1006Component : public PollingComponent, public uart::UARTDevice { public: @@ -33,5 +32,4 @@ class PM1006Component : public PollingComponent, public uart::UARTDevice { uint32_t last_transmission_{0}; }; -} // namespace pm1006 -} // namespace esphome +} // namespace esphome::pm1006 diff --git a/esphome/components/pm2005/pm2005.cpp b/esphome/components/pm2005/pm2005.cpp index d8e253a771..54a98bf3ad 100644 --- a/esphome/components/pm2005/pm2005.cpp +++ b/esphome/components/pm2005/pm2005.cpp @@ -1,8 +1,7 @@ #include "esphome/core/log.h" #include "pm2005.h" -namespace esphome { -namespace pm2005 { +namespace esphome::pm2005 { static const char *const TAG = "pm2005"; @@ -117,5 +116,4 @@ void PM2005Component::dump_config() { LOG_SENSOR(" ", "PM10 ", this->pm_10_0_sensor_); } -} // namespace pm2005 -} // namespace esphome +} // namespace esphome::pm2005 diff --git a/esphome/components/pm2005/pm2005.h b/esphome/components/pm2005/pm2005.h index e788569b7e..9661d082d1 100644 --- a/esphome/components/pm2005/pm2005.h +++ b/esphome/components/pm2005/pm2005.h @@ -4,8 +4,7 @@ #include "esphome/components/sensor/sensor.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace pm2005 { +namespace esphome::pm2005 { enum SensorType { PM2005, @@ -40,5 +39,4 @@ class PM2005Component : public PollingComponent, public i2c::I2CDevice { uint8_t measuring_value_index_{10}; }; -} // namespace pm2005 -} // namespace esphome +} // namespace esphome::pm2005 diff --git a/esphome/components/pmsa003i/pmsa003i.cpp b/esphome/components/pmsa003i/pmsa003i.cpp index 4a618586f8..15f5d3e879 100644 --- a/esphome/components/pmsa003i/pmsa003i.cpp +++ b/esphome/components/pmsa003i/pmsa003i.cpp @@ -3,8 +3,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace pmsa003i { +namespace esphome::pmsa003i { static const char *const TAG = "pmsa003i"; @@ -131,5 +130,4 @@ bool PMSA003IComponent::read_data_(PM25AQIData *data) { return true; } -} // namespace pmsa003i -} // namespace esphome +} // namespace esphome::pmsa003i diff --git a/esphome/components/pmsa003i/pmsa003i.h b/esphome/components/pmsa003i/pmsa003i.h index cd106704a6..aebe80b711 100644 --- a/esphome/components/pmsa003i/pmsa003i.h +++ b/esphome/components/pmsa003i/pmsa003i.h @@ -4,8 +4,7 @@ #include "esphome/components/sensor/sensor.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace pmsa003i { +namespace esphome::pmsa003i { /**! Structure holding Plantower's standard packet **/ // From https://github.com/adafruit/Adafruit_PM25AQI @@ -63,5 +62,4 @@ class PMSA003IComponent : public PollingComponent, public i2c::I2CDevice { sensor::Sensor *pmc_10_0_sensor_{nullptr}; }; -} // namespace pmsa003i -} // namespace esphome +} // namespace esphome::pmsa003i diff --git a/esphome/components/pmwcs3/pmwcs3.cpp b/esphome/components/pmwcs3/pmwcs3.cpp index 2ed7789c53..94c0c30766 100644 --- a/esphome/components/pmwcs3/pmwcs3.cpp +++ b/esphome/components/pmwcs3/pmwcs3.cpp @@ -2,8 +2,7 @@ #include "esphome/core/hal.h" #include "esphome/core/log.h" -namespace esphome { -namespace pmwcs3 { +namespace esphome::pmwcs3 { static const uint8_t PMWCS3_I2C_ADDRESS = 0x63; static const uint8_t PMWCS3_REG_READ_START = 0x01; @@ -106,5 +105,4 @@ void PMWCS3Component::read_data_() { }); } -} // namespace pmwcs3 -} // namespace esphome +} // namespace esphome::pmwcs3 diff --git a/esphome/components/pmwcs3/pmwcs3.h b/esphome/components/pmwcs3/pmwcs3.h index b1e26eec4f..d669147819 100644 --- a/esphome/components/pmwcs3/pmwcs3.h +++ b/esphome/components/pmwcs3/pmwcs3.h @@ -7,8 +7,7 @@ // ref: // https://github.com/tinovi/i2cArduino/blob/master/i2cArduino.h -namespace esphome { -namespace pmwcs3 { +namespace esphome::pmwcs3 { class PMWCS3Component : public PollingComponent, public i2c::I2CDevice { public: @@ -64,5 +63,4 @@ template class PMWCS3NewI2cAddressAction : public Action PMWCS3Component *parent_; }; -} // namespace pmwcs3 -} // namespace esphome +} // namespace esphome::pmwcs3 diff --git a/esphome/components/pn532/pn532.cpp b/esphome/components/pn532/pn532.cpp index 3017b78414..8ef7721726 100644 --- a/esphome/components/pn532/pn532.cpp +++ b/esphome/components/pn532/pn532.cpp @@ -9,8 +9,7 @@ // - https://www.nxp.com/docs/en/nxp/application-notes/AN133910.pdf // - https://www.nxp.com/docs/en/nxp/application-notes/153710.pdf -namespace esphome { -namespace pn532 { +namespace esphome::pn532 { static const char *const TAG = "pn532"; @@ -458,5 +457,4 @@ bool PN532BinarySensor::process(const nfc::NfcTagUid &data) { return true; } -} // namespace pn532 -} // namespace esphome +} // namespace esphome::pn532 diff --git a/esphome/components/pn532/pn532.h b/esphome/components/pn532/pn532.h index b76cbb1946..a26f27ed54 100644 --- a/esphome/components/pn532/pn532.h +++ b/esphome/components/pn532/pn532.h @@ -10,8 +10,7 @@ #include #include -namespace esphome { -namespace pn532 { +namespace esphome::pn532 { static const uint8_t PN532_COMMAND_VERSION_DATA = 0x02; static const uint8_t PN532_COMMAND_SAMCONFIGURATION = 0x14; @@ -138,5 +137,4 @@ template class PN532IsWritingCondition : public Condition bool check(const Ts &...x) override { return this->parent_->is_writing(); } }; -} // namespace pn532 -} // namespace esphome +} // namespace esphome::pn532 diff --git a/esphome/components/pn532/pn532_mifare_classic.cpp b/esphome/components/pn532/pn532_mifare_classic.cpp index cca6acd96d..37674080d8 100644 --- a/esphome/components/pn532/pn532_mifare_classic.cpp +++ b/esphome/components/pn532/pn532_mifare_classic.cpp @@ -4,8 +4,7 @@ #include "pn532.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn532 { +namespace esphome::pn532 { static const char *const TAG = "pn532.mifare_classic"; @@ -258,5 +257,4 @@ bool PN532::write_mifare_classic_tag_(nfc::NfcTagUid &uid, nfc::NdefMessage *mes return true; } -} // namespace pn532 -} // namespace esphome +} // namespace esphome::pn532 diff --git a/esphome/components/pn532/pn532_mifare_ultralight.cpp b/esphome/components/pn532/pn532_mifare_ultralight.cpp index 0e0dc1542f..eb3d13a7e0 100644 --- a/esphome/components/pn532/pn532_mifare_ultralight.cpp +++ b/esphome/components/pn532/pn532_mifare_ultralight.cpp @@ -4,8 +4,7 @@ #include "pn532.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn532 { +namespace esphome::pn532 { static const char *const TAG = "pn532.mifare_ultralight"; @@ -189,5 +188,4 @@ bool PN532::write_mifare_ultralight_page_(uint8_t page_num, const uint8_t *write return true; } -} // namespace pn532 -} // namespace esphome +} // namespace esphome::pn532 diff --git a/esphome/components/pn532_i2c/pn532_i2c.cpp b/esphome/components/pn532_i2c/pn532_i2c.cpp index 41f0f079aa..7f4d78461b 100644 --- a/esphome/components/pn532_i2c/pn532_i2c.cpp +++ b/esphome/components/pn532_i2c/pn532_i2c.cpp @@ -7,8 +7,7 @@ // - https://www.nxp.com/docs/en/nxp/application-notes/AN133910.pdf // - https://www.nxp.com/docs/en/nxp/application-notes/153710.pdf -namespace esphome { -namespace pn532_i2c { +namespace esphome::pn532_i2c { static const char *const TAG = "pn532_i2c"; @@ -125,5 +124,4 @@ void PN532I2C::dump_config() { LOG_I2C_DEVICE(this); } -} // namespace pn532_i2c -} // namespace esphome +} // namespace esphome::pn532_i2c diff --git a/esphome/components/pn532_i2c/pn532_i2c.h b/esphome/components/pn532_i2c/pn532_i2c.h index 00c0df206d..b2a2ac2e18 100644 --- a/esphome/components/pn532_i2c/pn532_i2c.h +++ b/esphome/components/pn532_i2c/pn532_i2c.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace pn532_i2c { +namespace esphome::pn532_i2c { class PN532I2C : public pn532::PN532, public i2c::I2CDevice { public: @@ -21,5 +20,4 @@ class PN532I2C : public pn532::PN532, public i2c::I2CDevice { uint8_t read_response_length_(); }; -} // namespace pn532_i2c -} // namespace esphome +} // namespace esphome::pn532_i2c diff --git a/esphome/components/pn532_spi/pn532_spi.cpp b/esphome/components/pn532_spi/pn532_spi.cpp index 553c6d26a6..13d9aebc20 100644 --- a/esphome/components/pn532_spi/pn532_spi.cpp +++ b/esphome/components/pn532_spi/pn532_spi.cpp @@ -7,8 +7,7 @@ // - https://www.nxp.com/docs/en/nxp/application-notes/AN133910.pdf // - https://www.nxp.com/docs/en/nxp/application-notes/153710.pdf -namespace esphome { -namespace pn532_spi { +namespace esphome::pn532_spi { static const char *const TAG = "pn532_spi"; @@ -151,5 +150,4 @@ void PN532Spi::dump_config() { LOG_PIN(" CS Pin: ", this->cs_); } -} // namespace pn532_spi -} // namespace esphome +} // namespace esphome::pn532_spi diff --git a/esphome/components/pn532_spi/pn532_spi.h b/esphome/components/pn532_spi/pn532_spi.h index b7adca22e9..2bfd4accf7 100644 --- a/esphome/components/pn532_spi/pn532_spi.h +++ b/esphome/components/pn532_spi/pn532_spi.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace pn532_spi { +namespace esphome::pn532_spi { class PN532Spi : public pn532::PN532, public spi::SPIDevice &data) override; }; -} // namespace pn532_spi -} // namespace esphome +} // namespace esphome::pn532_spi diff --git a/esphome/components/pn7150/automation.h b/esphome/components/pn7150/automation.h index a8c65ae633..0b2e5f5d24 100644 --- a/esphome/components/pn7150/automation.h +++ b/esphome/components/pn7150/automation.h @@ -4,8 +4,7 @@ #include "esphome/core/component.h" #include "esphome/components/pn7150/pn7150.h" -namespace esphome { -namespace pn7150 { +namespace esphome::pn7150 { template class PN7150IsWritingCondition : public Condition, public Parented { public: @@ -64,5 +63,4 @@ template class SetWriteModeAction : public Action, public void play(const Ts &...x) override { this->parent_->write_mode(); } }; -} // namespace pn7150 -} // namespace esphome +} // namespace esphome::pn7150 diff --git a/esphome/components/pn7150/pn7150.cpp b/esphome/components/pn7150/pn7150.cpp index d68bea41b3..2a2724f56b 100644 --- a/esphome/components/pn7150/pn7150.cpp +++ b/esphome/components/pn7150/pn7150.cpp @@ -7,8 +7,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn7150 { +namespace esphome::pn7150 { static const char *const TAG = "pn7150"; @@ -1160,5 +1159,4 @@ uint8_t PN7150::wait_for_irq_(uint16_t timeout, bool pin_state) { return nfc::STATUS_FAILED; } -} // namespace pn7150 -} // namespace esphome +} // namespace esphome::pn7150 diff --git a/esphome/components/pn7150/pn7150.h b/esphome/components/pn7150/pn7150.h index a468d80943..fa38c5c313 100644 --- a/esphome/components/pn7150/pn7150.h +++ b/esphome/components/pn7150/pn7150.h @@ -11,8 +11,7 @@ #include -namespace esphome { -namespace pn7150 { +namespace esphome::pn7150 { static constexpr uint16_t NFCC_DEFAULT_TIMEOUT = 10; static constexpr uint16_t NFCC_INIT_TIMEOUT = 50; @@ -292,5 +291,4 @@ class PN7150 : public nfc::Nfcc, public Component { std::vector triggers_ontagremoved_; }; -} // namespace pn7150 -} // namespace esphome +} // namespace esphome::pn7150 diff --git a/esphome/components/pn7150/pn7150_mifare_classic.cpp b/esphome/components/pn7150/pn7150_mifare_classic.cpp index 61434cdb28..f1832d95f1 100644 --- a/esphome/components/pn7150/pn7150_mifare_classic.cpp +++ b/esphome/components/pn7150/pn7150_mifare_classic.cpp @@ -4,8 +4,7 @@ #include "pn7150.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn7150 { +namespace esphome::pn7150 { static const char *const TAG = "pn7150.mifare_classic"; @@ -324,5 +323,4 @@ uint8_t PN7150::halt_mifare_classic_tag_() { return nfc::STATUS_OK; } -} // namespace pn7150 -} // namespace esphome +} // namespace esphome::pn7150 diff --git a/esphome/components/pn7150/pn7150_mifare_ultralight.cpp b/esphome/components/pn7150/pn7150_mifare_ultralight.cpp index 854ddd1be1..ef594144d9 100644 --- a/esphome/components/pn7150/pn7150_mifare_ultralight.cpp +++ b/esphome/components/pn7150/pn7150_mifare_ultralight.cpp @@ -5,8 +5,7 @@ #include "pn7150.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn7150 { +namespace esphome::pn7150 { static const char *const TAG = "pn7150.mifare_ultralight"; @@ -183,5 +182,4 @@ uint8_t PN7150::write_mifare_ultralight_page_(uint8_t page_num, const uint8_t *w return nfc::STATUS_OK; } -} // namespace pn7150 -} // namespace esphome +} // namespace esphome::pn7150 diff --git a/esphome/components/pn7150_i2c/pn7150_i2c.cpp b/esphome/components/pn7150_i2c/pn7150_i2c.cpp index 4ae884595b..a61bd27c64 100644 --- a/esphome/components/pn7150_i2c/pn7150_i2c.cpp +++ b/esphome/components/pn7150_i2c/pn7150_i2c.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include "esphome/core/hal.h" -namespace esphome { -namespace pn7150_i2c { +namespace esphome::pn7150_i2c { static const char *const TAG = "pn7150_i2c"; @@ -46,5 +45,4 @@ void PN7150I2C::dump_config() { LOG_I2C_DEVICE(this); } -} // namespace pn7150_i2c -} // namespace esphome +} // namespace esphome::pn7150_i2c diff --git a/esphome/components/pn7150_i2c/pn7150_i2c.h b/esphome/components/pn7150_i2c/pn7150_i2c.h index 9308dddd26..2ea8c8f75c 100644 --- a/esphome/components/pn7150_i2c/pn7150_i2c.h +++ b/esphome/components/pn7150_i2c/pn7150_i2c.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace pn7150_i2c { +namespace esphome::pn7150_i2c { class PN7150I2C : public pn7150::PN7150, public i2c::I2CDevice { public: @@ -18,5 +17,4 @@ class PN7150I2C : public pn7150::PN7150, public i2c::I2CDevice { uint8_t write_nfcc(nfc::NciMessage &tx) override; }; -} // namespace pn7150_i2c -} // namespace esphome +} // namespace esphome::pn7150_i2c diff --git a/esphome/components/pn7160/automation.h b/esphome/components/pn7160/automation.h index 7759da8f53..7300c4a8d6 100644 --- a/esphome/components/pn7160/automation.h +++ b/esphome/components/pn7160/automation.h @@ -4,8 +4,7 @@ #include "esphome/core/component.h" #include "esphome/components/pn7160/pn7160.h" -namespace esphome { -namespace pn7160 { +namespace esphome::pn7160 { template class PN7160IsWritingCondition : public Condition, public Parented { public: @@ -64,5 +63,4 @@ template class SetWriteModeAction : public Action, public void play(const Ts &...x) override { this->parent_->write_mode(); } }; -} // namespace pn7160 -} // namespace esphome +} // namespace esphome::pn7160 diff --git a/esphome/components/pn7160/pn7160.cpp b/esphome/components/pn7160/pn7160.cpp index 5f0f8d0629..7abd89b371 100644 --- a/esphome/components/pn7160/pn7160.cpp +++ b/esphome/components/pn7160/pn7160.cpp @@ -7,8 +7,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn7160 { +namespace esphome::pn7160 { static const char *const TAG = "pn7160"; @@ -1186,5 +1185,4 @@ uint8_t PN7160::wait_for_irq_(uint16_t timeout, bool pin_state) { return nfc::STATUS_FAILED; } -} // namespace pn7160 -} // namespace esphome +} // namespace esphome::pn7160 diff --git a/esphome/components/pn7160/pn7160.h b/esphome/components/pn7160/pn7160.h index 44f7eb0796..da4577874c 100644 --- a/esphome/components/pn7160/pn7160.h +++ b/esphome/components/pn7160/pn7160.h @@ -11,8 +11,7 @@ #include -namespace esphome { -namespace pn7160 { +namespace esphome::pn7160 { static constexpr uint16_t NFCC_DEFAULT_TIMEOUT = 10; static constexpr uint16_t NFCC_INIT_TIMEOUT = 50; @@ -311,5 +310,4 @@ class PN7160 : public nfc::Nfcc, public Component { std::vector triggers_ontagremoved_; }; -} // namespace pn7160 -} // namespace esphome +} // namespace esphome::pn7160 diff --git a/esphome/components/pn7160/pn7160_mifare_classic.cpp b/esphome/components/pn7160/pn7160_mifare_classic.cpp index 710a7198c6..0dc8bbdfe4 100644 --- a/esphome/components/pn7160/pn7160_mifare_classic.cpp +++ b/esphome/components/pn7160/pn7160_mifare_classic.cpp @@ -4,8 +4,7 @@ #include "pn7160.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn7160 { +namespace esphome::pn7160 { static const char *const TAG = "pn7160.mifare_classic"; @@ -324,5 +323,4 @@ uint8_t PN7160::halt_mifare_classic_tag_() { return nfc::STATUS_OK; } -} // namespace pn7160 -} // namespace esphome +} // namespace esphome::pn7160 diff --git a/esphome/components/pn7160/pn7160_mifare_ultralight.cpp b/esphome/components/pn7160/pn7160_mifare_ultralight.cpp index 8ca0fa2c11..e319a4cb2e 100644 --- a/esphome/components/pn7160/pn7160_mifare_ultralight.cpp +++ b/esphome/components/pn7160/pn7160_mifare_ultralight.cpp @@ -5,8 +5,7 @@ #include "pn7160.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn7160 { +namespace esphome::pn7160 { static const char *const TAG = "pn7160.mifare_ultralight"; @@ -183,5 +182,4 @@ uint8_t PN7160::write_mifare_ultralight_page_(uint8_t page_num, const uint8_t *w return nfc::STATUS_OK; } -} // namespace pn7160 -} // namespace esphome +} // namespace esphome::pn7160 diff --git a/esphome/components/pn7160_i2c/pn7160_i2c.cpp b/esphome/components/pn7160_i2c/pn7160_i2c.cpp index e33c6c793d..c34cf90e68 100644 --- a/esphome/components/pn7160_i2c/pn7160_i2c.cpp +++ b/esphome/components/pn7160_i2c/pn7160_i2c.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include "esphome/core/hal.h" -namespace esphome { -namespace pn7160_i2c { +namespace esphome::pn7160_i2c { static const char *const TAG = "pn7160_i2c"; @@ -46,5 +45,4 @@ void PN7160I2C::dump_config() { LOG_I2C_DEVICE(this); } -} // namespace pn7160_i2c -} // namespace esphome +} // namespace esphome::pn7160_i2c diff --git a/esphome/components/pn7160_i2c/pn7160_i2c.h b/esphome/components/pn7160_i2c/pn7160_i2c.h index eb253085eb..d29fd04fac 100644 --- a/esphome/components/pn7160_i2c/pn7160_i2c.h +++ b/esphome/components/pn7160_i2c/pn7160_i2c.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace pn7160_i2c { +namespace esphome::pn7160_i2c { class PN7160I2C : public pn7160::PN7160, public i2c::I2CDevice { public: @@ -18,5 +17,4 @@ class PN7160I2C : public pn7160::PN7160, public i2c::I2CDevice { uint8_t write_nfcc(nfc::NciMessage &tx) override; }; -} // namespace pn7160_i2c -} // namespace esphome +} // namespace esphome::pn7160_i2c diff --git a/esphome/components/pn7160_spi/pn7160_spi.cpp b/esphome/components/pn7160_spi/pn7160_spi.cpp index 09f673f700..f3c413e952 100644 --- a/esphome/components/pn7160_spi/pn7160_spi.cpp +++ b/esphome/components/pn7160_spi/pn7160_spi.cpp @@ -1,8 +1,7 @@ #include "pn7160_spi.h" #include "esphome/core/log.h" -namespace esphome { -namespace pn7160_spi { +namespace esphome::pn7160_spi { static const char *const TAG = "pn7160_spi"; @@ -50,5 +49,4 @@ void PN7160Spi::dump_config() { LOG_PIN(" CS Pin: ", this->cs_); } -} // namespace pn7160_spi -} // namespace esphome +} // namespace esphome::pn7160_spi diff --git a/esphome/components/pn7160_spi/pn7160_spi.h b/esphome/components/pn7160_spi/pn7160_spi.h index 9b6e21fa2a..2d9c1fda11 100644 --- a/esphome/components/pn7160_spi/pn7160_spi.h +++ b/esphome/components/pn7160_spi/pn7160_spi.h @@ -7,8 +7,7 @@ #include -namespace esphome { -namespace pn7160_spi { +namespace esphome::pn7160_spi { static constexpr uint8_t TDD_SPI_READ = 0xFF; static constexpr uint8_t TDD_SPI_WRITE = 0x0A; @@ -26,5 +25,4 @@ class PN7160Spi : public pn7160::PN7160, uint8_t write_nfcc(nfc::NciMessage &tx) override; }; -} // namespace pn7160_spi -} // namespace esphome +} // namespace esphome::pn7160_spi diff --git a/esphome/components/power_supply/power_supply.cpp b/esphome/components/power_supply/power_supply.cpp index 5db2122412..4da73e76ae 100644 --- a/esphome/components/power_supply/power_supply.cpp +++ b/esphome/components/power_supply/power_supply.cpp @@ -1,8 +1,7 @@ #include "power_supply.h" #include "esphome/core/log.h" -namespace esphome { -namespace power_supply { +namespace esphome::power_supply { static const char *const TAG = "power_supply"; @@ -54,5 +53,4 @@ void PowerSupply::on_powerdown() { this->pin_->digital_write(false); } -} // namespace power_supply -} // namespace esphome +} // namespace esphome::power_supply diff --git a/esphome/components/power_supply/power_supply.h b/esphome/components/power_supply/power_supply.h index 0387074eb8..e096f69e3b 100644 --- a/esphome/components/power_supply/power_supply.h +++ b/esphome/components/power_supply/power_supply.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace power_supply { +namespace esphome::power_supply { class PowerSupply : public Component { public: @@ -63,5 +62,4 @@ class PowerSupplyRequester { bool requested_{false}; }; -} // namespace power_supply -} // namespace esphome +} // namespace esphome::power_supply diff --git a/esphome/components/preferences/syncer.h b/esphome/components/preferences/syncer.h index e28cc8c8d5..cee02394b4 100644 --- a/esphome/components/preferences/syncer.h +++ b/esphome/components/preferences/syncer.h @@ -3,8 +3,7 @@ #include "esphome/core/preferences.h" #include "esphome/core/component.h" -namespace esphome { -namespace preferences { +namespace esphome::preferences { class IntervalSyncer final : public Component { public: @@ -25,5 +24,4 @@ class IntervalSyncer final : public Component { #endif }; -} // namespace preferences -} // namespace esphome +} // namespace esphome::preferences diff --git a/esphome/components/prometheus/prometheus_handler.cpp b/esphome/components/prometheus/prometheus_handler.cpp index e2639a2298..0412d8a842 100644 --- a/esphome/components/prometheus/prometheus_handler.cpp +++ b/esphome/components/prometheus/prometheus_handler.cpp @@ -2,8 +2,7 @@ #ifdef USE_NETWORK #include "esphome/core/application.h" -namespace esphome { -namespace prometheus { +namespace esphome::prometheus { void PrometheusHandler::handleRequest(AsyncWebServerRequest *req) { AsyncResponseStream *stream = req->beginResponseStream("text/plain; version=0.0.4; charset=utf-8"); @@ -1098,6 +1097,6 @@ void PrometheusHandler::climate_row_(AsyncResponseStream *stream, climate::Clima } #endif -} // namespace prometheus -} // namespace esphome +} // namespace esphome::prometheus + #endif diff --git a/esphome/components/prometheus/prometheus_handler.h b/esphome/components/prometheus/prometheus_handler.h index 7aecab99d1..53326e9472 100644 --- a/esphome/components/prometheus/prometheus_handler.h +++ b/esphome/components/prometheus/prometheus_handler.h @@ -12,8 +12,7 @@ #include "esphome/core/log.h" #endif -namespace esphome { -namespace prometheus { +namespace esphome::prometheus { class PrometheusHandler : public AsyncWebHandler, public Component { public: @@ -218,6 +217,6 @@ class PrometheusHandler : public AsyncWebHandler, public Component { std::map relabel_map_name_; }; -} // namespace prometheus -} // namespace esphome +} // namespace esphome::prometheus + #endif diff --git a/esphome/components/psram/psram.cpp b/esphome/components/psram/psram.cpp index 6c110a577d..ab680c9695 100644 --- a/esphome/components/psram/psram.cpp +++ b/esphome/components/psram/psram.cpp @@ -8,8 +8,7 @@ #include -namespace esphome { -namespace psram { +namespace esphome::psram { static const char *const TAG = "psram"; void PsramComponent::dump_config() { @@ -25,7 +24,6 @@ void PsramComponent::dump_config() { } } -} // namespace psram -} // namespace esphome +} // namespace esphome::psram #endif diff --git a/esphome/components/psram/psram.h b/esphome/components/psram/psram.h index 8c891feee9..22a49588b4 100644 --- a/esphome/components/psram/psram.h +++ b/esphome/components/psram/psram.h @@ -4,14 +4,12 @@ #include "esphome/core/component.h" -namespace esphome { -namespace psram { +namespace esphome::psram { class PsramComponent : public Component { void dump_config() override; }; -} // namespace psram -} // namespace esphome +} // namespace esphome::psram #endif diff --git a/esphome/components/pulse_counter/automation.h b/esphome/components/pulse_counter/automation.h index 0c0dc2552d..14264e87b3 100644 --- a/esphome/components/pulse_counter/automation.h +++ b/esphome/components/pulse_counter/automation.h @@ -4,9 +4,7 @@ #include "esphome/core/automation.h" #include "esphome/components/pulse_counter/pulse_counter_sensor.h" -namespace esphome { - -namespace pulse_counter { +namespace esphome::pulse_counter { template class SetTotalPulsesAction : public Action { public: @@ -20,5 +18,4 @@ template class SetTotalPulsesAction : public Action { PulseCounterSensor *pulse_counter_; }; -} // namespace pulse_counter -} // namespace esphome +} // namespace esphome::pulse_counter diff --git a/esphome/components/pulse_counter/pulse_counter_sensor.cpp b/esphome/components/pulse_counter/pulse_counter_sensor.cpp index 5d73bef7da..13bf3baf83 100644 --- a/esphome/components/pulse_counter/pulse_counter_sensor.cpp +++ b/esphome/components/pulse_counter/pulse_counter_sensor.cpp @@ -7,8 +7,7 @@ #include #endif -namespace esphome { -namespace pulse_counter { +namespace esphome::pulse_counter { static const char *const TAG = "pulse_counter"; @@ -210,5 +209,4 @@ void PulseCounterSensor::update() { this->last_time_ = now; } -} // namespace pulse_counter -} // namespace esphome +} // namespace esphome::pulse_counter diff --git a/esphome/components/pulse_counter/pulse_counter_sensor.h b/esphome/components/pulse_counter/pulse_counter_sensor.h index 7a68858099..4f23ef1548 100644 --- a/esphome/components/pulse_counter/pulse_counter_sensor.h +++ b/esphome/components/pulse_counter/pulse_counter_sensor.h @@ -14,8 +14,7 @@ #endif // defined(SOC_PCNT_SUPPORTED) && __has_include() #endif // USE_ESP32 -namespace esphome { -namespace pulse_counter { +namespace esphome::pulse_counter { enum PulseCounterCountMode { PULSE_COUNTER_DISABLE = 0, @@ -85,5 +84,4 @@ class PulseCounterSensor : public sensor::Sensor, public PollingComponent { sensor::Sensor *total_sensor_{nullptr}; }; -} // namespace pulse_counter -} // namespace esphome +} // namespace esphome::pulse_counter diff --git a/esphome/components/pulse_meter/automation.h b/esphome/components/pulse_meter/automation.h index bf0768b7af..1def89c3d3 100644 --- a/esphome/components/pulse_meter/automation.h +++ b/esphome/components/pulse_meter/automation.h @@ -4,9 +4,7 @@ #include "esphome/core/automation.h" #include "esphome/components/pulse_meter/pulse_meter_sensor.h" -namespace esphome { - -namespace pulse_meter { +namespace esphome::pulse_meter { template class SetTotalPulsesAction : public Action { public: @@ -20,5 +18,4 @@ template class SetTotalPulsesAction : public Action { PulseMeterSensor *pulse_meter_; }; -} // namespace pulse_meter -} // namespace esphome +} // namespace esphome::pulse_meter diff --git a/esphome/components/pulse_meter/pulse_meter_sensor.cpp b/esphome/components/pulse_meter/pulse_meter_sensor.cpp index 433e1f0b7e..3fe1c722eb 100644 --- a/esphome/components/pulse_meter/pulse_meter_sensor.cpp +++ b/esphome/components/pulse_meter/pulse_meter_sensor.cpp @@ -2,8 +2,7 @@ #include #include "esphome/core/log.h" -namespace esphome { -namespace pulse_meter { +namespace esphome::pulse_meter { static const char *const TAG = "pulse_meter"; @@ -186,5 +185,4 @@ void IRAM_ATTR PulseMeterSensor::pulse_intr(PulseMeterSensor *sensor) { sensor->last_pin_val_ = pin_val; } -} // namespace pulse_meter -} // namespace esphome +} // namespace esphome::pulse_meter diff --git a/esphome/components/pulse_meter/pulse_meter_sensor.h b/esphome/components/pulse_meter/pulse_meter_sensor.h index e46f1e615f..243a64bf05 100644 --- a/esphome/components/pulse_meter/pulse_meter_sensor.h +++ b/esphome/components/pulse_meter/pulse_meter_sensor.h @@ -7,8 +7,7 @@ #include -namespace esphome { -namespace pulse_meter { +namespace esphome::pulse_meter { class PulseMeterSensor : public sensor::Sensor, public Component { public: @@ -77,5 +76,4 @@ class PulseMeterSensor : public sensor::Sensor, public Component { PulseState pulse_state_{}; }; -} // namespace pulse_meter -} // namespace esphome +} // namespace esphome::pulse_meter diff --git a/esphome/components/pulse_width/pulse_width.cpp b/esphome/components/pulse_width/pulse_width.cpp index d083d48b32..5209ed5352 100644 --- a/esphome/components/pulse_width/pulse_width.cpp +++ b/esphome/components/pulse_width/pulse_width.cpp @@ -1,8 +1,7 @@ #include "pulse_width.h" #include "esphome/core/log.h" -namespace esphome { -namespace pulse_width { +namespace esphome::pulse_width { static const char *const TAG = "pulse_width"; @@ -27,5 +26,4 @@ void PulseWidthSensor::update() { this->publish_state(width); } -} // namespace pulse_width -} // namespace esphome +} // namespace esphome::pulse_width diff --git a/esphome/components/pulse_width/pulse_width.h b/esphome/components/pulse_width/pulse_width.h index c6b896988d..f77766a961 100644 --- a/esphome/components/pulse_width/pulse_width.h +++ b/esphome/components/pulse_width/pulse_width.h @@ -4,8 +4,7 @@ #include "esphome/core/hal.h" #include "esphome/components/sensor/sensor.h" -namespace esphome { -namespace pulse_width { +namespace esphome::pulse_width { /// Store data in a class that doesn't use multiple-inheritance (vtables in flash) class PulseWidthSensorStore { @@ -39,5 +38,4 @@ class PulseWidthSensor : public sensor::Sensor, public PollingComponent { InternalGPIOPin *pin_; }; -} // namespace pulse_width -} // namespace esphome +} // namespace esphome::pulse_width diff --git a/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp b/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp index 4d4a5466bb..7a6be40d6c 100644 --- a/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp +++ b/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp @@ -3,8 +3,8 @@ #include "esphome/core/log.h" #ifdef USE_ESP32 -namespace esphome { -namespace pvvx_mithermometer { + +namespace esphome::pvvx_mithermometer { static const char *const TAG = "display.pvvx_mithermometer"; @@ -186,7 +186,6 @@ void PVVXDisplay::sync_time_() { } #endif -} // namespace pvvx_mithermometer -} // namespace esphome +} // namespace esphome::pvvx_mithermometer #endif diff --git a/esphome/components/pvvx_mithermometer/display/pvvx_display.h b/esphome/components/pvvx_mithermometer/display/pvvx_display.h index 06837b94ab..e1aebae7a5 100644 --- a/esphome/components/pvvx_mithermometer/display/pvvx_display.h +++ b/esphome/components/pvvx_mithermometer/display/pvvx_display.h @@ -13,8 +13,7 @@ #include "esphome/components/time/real_time_clock.h" #endif -namespace esphome { -namespace pvvx_mithermometer { +namespace esphome::pvvx_mithermometer { class PVVXDisplay; @@ -130,7 +129,6 @@ class PVVXDisplay : public ble_client::BLEClientNode, public PollingComponent { pvvx_writer_t writer_{}; }; -} // namespace pvvx_mithermometer -} // namespace esphome +} // namespace esphome::pvvx_mithermometer #endif diff --git a/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp b/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp index 35badf48bb..f674fc3694 100644 --- a/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp +++ b/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp @@ -3,8 +3,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace pvvx_mithermometer { +namespace esphome::pvvx_mithermometer { static const char *const TAG = "pvvx_mithermometer"; @@ -140,7 +139,6 @@ bool PVVXMiThermometer::report_results_(const optional &result, con return true; } -} // namespace pvvx_mithermometer -} // namespace esphome +} // namespace esphome::pvvx_mithermometer #endif diff --git a/esphome/components/pvvx_mithermometer/pvvx_mithermometer.h b/esphome/components/pvvx_mithermometer/pvvx_mithermometer.h index 09b5e91a16..b5d6da21ef 100644 --- a/esphome/components/pvvx_mithermometer/pvvx_mithermometer.h +++ b/esphome/components/pvvx_mithermometer/pvvx_mithermometer.h @@ -8,8 +8,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace pvvx_mithermometer { +namespace esphome::pvvx_mithermometer { struct ParseResult { optional temperature; @@ -46,7 +45,6 @@ class PVVXMiThermometer : public Component, public esp32_ble_tracker::ESPBTDevic bool report_results_(const optional &result, const char *address); }; -} // namespace pvvx_mithermometer -} // namespace esphome +} // namespace esphome::pvvx_mithermometer #endif diff --git a/esphome/components/pylontech/pylontech.cpp b/esphome/components/pylontech/pylontech.cpp index 7eb89d5b32..0973699da8 100644 --- a/esphome/components/pylontech/pylontech.cpp +++ b/esphome/components/pylontech/pylontech.cpp @@ -24,8 +24,7 @@ } \ } -namespace esphome { -namespace pylontech { +namespace esphome::pylontech { static const char *const TAG = "pylontech"; static const int MAX_DATA_LENGTH_BYTES = 256; @@ -198,8 +197,7 @@ void PylontechComponent::process_line_(std::string &buffer) { } } -} // namespace pylontech -} // namespace esphome +} // namespace esphome::pylontech #undef PARSE_INT #undef PARSE_STR diff --git a/esphome/components/pylontech/pylontech.h b/esphome/components/pylontech/pylontech.h index 5727928a60..1d86803cc2 100644 --- a/esphome/components/pylontech/pylontech.h +++ b/esphome/components/pylontech/pylontech.h @@ -4,8 +4,7 @@ #include "esphome/core/defines.h" #include "esphome/components/uart/uart.h" -namespace esphome { -namespace pylontech { +namespace esphome::pylontech { static const uint8_t NUM_BUFFERS = 20; static const uint8_t TEXT_SENSOR_MAX_LEN = 14; @@ -48,5 +47,4 @@ class PylontechComponent : public PollingComponent, public uart::UARTDevice { std::vector listeners_{}; }; -} // namespace pylontech -} // namespace esphome +} // namespace esphome::pylontech diff --git a/esphome/components/pylontech/sensor/pylontech_sensor.cpp b/esphome/components/pylontech/sensor/pylontech_sensor.cpp index 11437369ed..e2def28be5 100644 --- a/esphome/components/pylontech/sensor/pylontech_sensor.cpp +++ b/esphome/components/pylontech/sensor/pylontech_sensor.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pylontech { +namespace esphome::pylontech { static const char *const TAG = "pylontech.sensor"; @@ -58,5 +57,4 @@ void PylontechSensor::on_line_read(PylontechListener::LineContents *line) { } } -} // namespace pylontech -} // namespace esphome +} // namespace esphome::pylontech diff --git a/esphome/components/pylontech/sensor/pylontech_sensor.h b/esphome/components/pylontech/sensor/pylontech_sensor.h index 25e71606a4..36576e8332 100644 --- a/esphome/components/pylontech/sensor/pylontech_sensor.h +++ b/esphome/components/pylontech/sensor/pylontech_sensor.h @@ -3,8 +3,7 @@ #include "../pylontech.h" #include "esphome/components/sensor/sensor.h" -namespace esphome { -namespace pylontech { +namespace esphome::pylontech { class PylontechSensor : public PylontechListener { public: @@ -28,5 +27,4 @@ class PylontechSensor : public PylontechListener { int8_t bat_num_; }; -} // namespace pylontech -} // namespace esphome +} // namespace esphome::pylontech diff --git a/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp b/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp index 8175477cb2..a7c9db1599 100644 --- a/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp +++ b/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace pylontech { +namespace esphome::pylontech { static const char *const TAG = "pylontech.textsensor"; @@ -38,5 +37,4 @@ void PylontechTextSensor::on_line_read(PylontechListener::LineContents *line) { } } -} // namespace pylontech -} // namespace esphome +} // namespace esphome::pylontech diff --git a/esphome/components/pylontech/text_sensor/pylontech_text_sensor.h b/esphome/components/pylontech/text_sensor/pylontech_text_sensor.h index 27a3993b3e..30921b13f4 100644 --- a/esphome/components/pylontech/text_sensor/pylontech_text_sensor.h +++ b/esphome/components/pylontech/text_sensor/pylontech_text_sensor.h @@ -3,8 +3,7 @@ #include "../pylontech.h" #include "esphome/components/text_sensor/text_sensor.h" -namespace esphome { -namespace pylontech { +namespace esphome::pylontech { class PylontechTextSensor : public PylontechListener { public: @@ -22,5 +21,4 @@ class PylontechTextSensor : public PylontechListener { int8_t bat_num_; }; -} // namespace pylontech -} // namespace esphome +} // namespace esphome::pylontech diff --git a/esphome/components/pzem004t/pzem004t.cpp b/esphome/components/pzem004t/pzem004t.cpp index d0f96d6d1e..a28b448340 100644 --- a/esphome/components/pzem004t/pzem004t.cpp +++ b/esphome/components/pzem004t/pzem004t.cpp @@ -3,8 +3,7 @@ #include "esphome/core/application.h" #include -namespace esphome { -namespace pzem004t { +namespace esphome::pzem004t { static const char *const TAG = "pzem004t"; @@ -126,5 +125,4 @@ void PZEM004T::dump_config() { LOG_SENSOR("", "Power", this->power_sensor_); } -} // namespace pzem004t -} // namespace esphome +} // namespace esphome::pzem004t diff --git a/esphome/components/pzem004t/pzem004t.h b/esphome/components/pzem004t/pzem004t.h index e18413f35c..71fc1e70ad 100644 --- a/esphome/components/pzem004t/pzem004t.h +++ b/esphome/components/pzem004t/pzem004t.h @@ -4,8 +4,7 @@ #include "esphome/components/uart/uart.h" #include "esphome/components/sensor/sensor.h" -namespace esphome { -namespace pzem004t { +namespace esphome::pzem004t { class PZEM004T : public PollingComponent, public uart::UARTDevice { public: @@ -42,5 +41,4 @@ class PZEM004T : public PollingComponent, public uart::UARTDevice { uint32_t last_read_{0}; }; -} // namespace pzem004t -} // namespace esphome +} // namespace esphome::pzem004t diff --git a/esphome/components/pzemac/pzemac.cpp b/esphome/components/pzemac/pzemac.cpp index 0dbe0e761d..d36e5d0250 100644 --- a/esphome/components/pzemac/pzemac.cpp +++ b/esphome/components/pzemac/pzemac.cpp @@ -1,8 +1,7 @@ #include "pzemac.h" #include "esphome/core/log.h" -namespace esphome { -namespace pzemac { +namespace esphome::pzemac { static const char *const TAG = "pzemac"; @@ -83,5 +82,4 @@ void PZEMAC::reset_energy_() { this->send_raw(cmd); } -} // namespace pzemac -} // namespace esphome +} // namespace esphome::pzemac diff --git a/esphome/components/pzemac/pzemac.h b/esphome/components/pzemac/pzemac.h index e5b96115f9..264604fedc 100644 --- a/esphome/components/pzemac/pzemac.h +++ b/esphome/components/pzemac/pzemac.h @@ -7,8 +7,7 @@ #include -namespace esphome { -namespace pzemac { +namespace esphome::pzemac { template class ResetEnergyAction; @@ -49,5 +48,4 @@ template class ResetEnergyAction : public Action { PZEMAC *pzemac_; }; -} // namespace pzemac -} // namespace esphome +} // namespace esphome::pzemac diff --git a/esphome/components/pzemdc/pzemdc.cpp b/esphome/components/pzemdc/pzemdc.cpp index 428bcc1fcf..6ded9b3a34 100644 --- a/esphome/components/pzemdc/pzemdc.cpp +++ b/esphome/components/pzemdc/pzemdc.cpp @@ -1,8 +1,7 @@ #include "pzemdc.h" #include "esphome/core/log.h" -namespace esphome { -namespace pzemdc { +namespace esphome::pzemdc { static const char *const TAG = "pzemdc"; @@ -71,5 +70,4 @@ void PZEMDC::reset_energy() { this->send_raw(cmd); } -} // namespace pzemdc -} // namespace esphome +} // namespace esphome::pzemdc diff --git a/esphome/components/pzemdc/pzemdc.h b/esphome/components/pzemdc/pzemdc.h index 2e6c26a10c..6a7e840448 100644 --- a/esphome/components/pzemdc/pzemdc.h +++ b/esphome/components/pzemdc/pzemdc.h @@ -7,8 +7,7 @@ #include -namespace esphome { -namespace pzemdc { +namespace esphome::pzemdc { class PZEMDC : public PollingComponent, public modbus::ModbusDevice { public: @@ -42,5 +41,4 @@ template class ResetEnergyAction : public Action { PZEMDC *pzemdc_; }; -} // namespace pzemdc -} // namespace esphome +} // namespace esphome::pzemdc diff --git a/esphome/components/qmc5883l/qmc5883l.cpp b/esphome/components/qmc5883l/qmc5883l.cpp index 44bd006c1a..5b04a904b5 100644 --- a/esphome/components/qmc5883l/qmc5883l.cpp +++ b/esphome/components/qmc5883l/qmc5883l.cpp @@ -4,8 +4,7 @@ #include "esphome/core/hal.h" #include -namespace esphome { -namespace qmc5883l { +namespace esphome::qmc5883l { static const char *const TAG = "qmc5883l"; @@ -213,5 +212,4 @@ i2c::ErrorCode QMC5883LComponent::read_bytes_16_le_(uint8_t a_register, uint16_t return err; } -} // namespace qmc5883l -} // namespace esphome +} // namespace esphome::qmc5883l diff --git a/esphome/components/qmc5883l/qmc5883l.h b/esphome/components/qmc5883l/qmc5883l.h index 2ab6aa3e9f..6b8ffa0f40 100644 --- a/esphome/components/qmc5883l/qmc5883l.h +++ b/esphome/components/qmc5883l/qmc5883l.h @@ -5,8 +5,7 @@ #include "esphome/components/i2c/i2c.h" #include "esphome/core/hal.h" -namespace esphome { -namespace qmc5883l { +namespace esphome::qmc5883l { enum QMC5883LDatarate { QMC5883L_DATARATE_10_HZ = 0b00, @@ -66,5 +65,4 @@ class QMC5883LComponent : public PollingComponent, public i2c::I2CDevice { HighFrequencyLoopRequester high_freq_; }; -} // namespace qmc5883l -} // namespace esphome +} // namespace esphome::qmc5883l diff --git a/esphome/components/qmp6988/qmp6988.cpp b/esphome/components/qmp6988/qmp6988.cpp index 976efe7910..8c8a04c5b7 100644 --- a/esphome/components/qmp6988/qmp6988.cpp +++ b/esphome/components/qmp6988/qmp6988.cpp @@ -3,8 +3,7 @@ #include #include -namespace esphome { -namespace qmp6988 { +namespace esphome::qmp6988 { static const uint8_t QMP6988_CHIP_ID = 0x5C; @@ -351,5 +350,4 @@ void QMP6988Component::update() { this->pressure_sensor_->publish_state(pressurehectopascals); } -} // namespace qmp6988 -} // namespace esphome +} // namespace esphome::qmp6988 diff --git a/esphome/components/qmp6988/qmp6988.h b/esphome/components/qmp6988/qmp6988.h index 5b0f80c77e..26f858b5d2 100644 --- a/esphome/components/qmp6988/qmp6988.h +++ b/esphome/components/qmp6988/qmp6988.h @@ -7,8 +7,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace qmp6988 { +namespace esphome::qmp6988 { /* oversampling */ enum QMP6988Oversampling : uint8_t { @@ -106,5 +105,4 @@ class QMP6988Component : public PollingComponent, public i2c::I2CDevice { int16_t get_compensated_temperature_(qmp6988_ik_data_t *ik, int32_t dt); }; -} // namespace qmp6988 -} // namespace esphome +} // namespace esphome::qmp6988 diff --git a/esphome/components/qr_code/qr_code.cpp b/esphome/components/qr_code/qr_code.cpp index 0322c8a141..edb78b98e1 100644 --- a/esphome/components/qr_code/qr_code.cpp +++ b/esphome/components/qr_code/qr_code.cpp @@ -3,8 +3,7 @@ #include "esphome/core/color.h" #include "esphome/core/log.h" -namespace esphome { -namespace qr_code { +namespace esphome::qr_code { static const char *const TAG = "qr_code"; @@ -74,5 +73,4 @@ uint8_t QrCode::get_size() { return size; } -} // namespace qr_code -} // namespace esphome +} // namespace esphome::qr_code diff --git a/esphome/components/qwiic_pir/qwiic_pir.cpp b/esphome/components/qwiic_pir/qwiic_pir.cpp index c04c0fcc18..baf8dc122d 100644 --- a/esphome/components/qwiic_pir/qwiic_pir.cpp +++ b/esphome/components/qwiic_pir/qwiic_pir.cpp @@ -1,8 +1,7 @@ #include "qwiic_pir.h" #include "esphome/core/log.h" -namespace esphome { -namespace qwiic_pir { +namespace esphome::qwiic_pir { static const char *const TAG = "qwiic_pir"; @@ -129,5 +128,4 @@ void QwiicPIRComponent::clear_events_() { ESP_LOGW(TAG, "Failed to clear events"); } -} // namespace qwiic_pir -} // namespace esphome +} // namespace esphome::qwiic_pir diff --git a/esphome/components/qwiic_pir/qwiic_pir.h b/esphome/components/qwiic_pir/qwiic_pir.h index 797ded2cc6..339632a508 100644 --- a/esphome/components/qwiic_pir/qwiic_pir.h +++ b/esphome/components/qwiic_pir/qwiic_pir.h @@ -12,8 +12,7 @@ #include "esphome/components/binary_sensor/binary_sensor.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace qwiic_pir { +namespace esphome::qwiic_pir { // Qwiic PIR I2C Register Addresses enum { @@ -65,5 +64,4 @@ class QwiicPIRComponent : public Component, public i2c::I2CDevice, public binary void clear_events_(); }; -} // namespace qwiic_pir -} // namespace esphome +} // namespace esphome::qwiic_pir diff --git a/esphome/components/radon_eye_ble/radon_eye_listener.cpp b/esphome/components/radon_eye_ble/radon_eye_listener.cpp index 2c3ef77add..7e7263d73f 100644 --- a/esphome/components/radon_eye_ble/radon_eye_listener.cpp +++ b/esphome/components/radon_eye_ble/radon_eye_listener.cpp @@ -4,8 +4,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace radon_eye_ble { +namespace esphome::radon_eye_ble { static const char *const TAG = "radon_eye_ble"; @@ -19,7 +18,6 @@ bool RadonEyeListener::parse_device(const esp32_ble_tracker::ESPBTDevice &device return false; } -} // namespace radon_eye_ble -} // namespace esphome +} // namespace esphome::radon_eye_ble #endif diff --git a/esphome/components/radon_eye_ble/radon_eye_listener.h b/esphome/components/radon_eye_ble/radon_eye_listener.h index 26d0233c56..ceca736e78 100644 --- a/esphome/components/radon_eye_ble/radon_eye_listener.h +++ b/esphome/components/radon_eye_ble/radon_eye_listener.h @@ -5,15 +5,13 @@ #include "esphome/core/component.h" #include "esphome/components/esp32_ble_tracker/esp32_ble_tracker.h" -namespace esphome { -namespace radon_eye_ble { +namespace esphome::radon_eye_ble { class RadonEyeListener : public esp32_ble_tracker::ESPBTDeviceListener { public: bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override; }; -} // namespace radon_eye_ble -} // namespace esphome +} // namespace esphome::radon_eye_ble #endif diff --git a/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp b/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp index f2d32d51de..de5bd3d8d5 100644 --- a/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp +++ b/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp @@ -5,8 +5,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace radon_eye_rd200 { +namespace esphome::radon_eye_rd200 { static const char *const TAG = "radon_eye_rd200"; @@ -211,7 +210,6 @@ void RadonEyeRD200::dump_config() { RadonEyeRD200::RadonEyeRD200() : PollingComponent(10000) {} -} // namespace radon_eye_rd200 -} // namespace esphome +} // namespace esphome::radon_eye_rd200 #endif // USE_ESP32 diff --git a/esphome/components/radon_eye_rd200/radon_eye_rd200.h b/esphome/components/radon_eye_rd200/radon_eye_rd200.h index f874c815f8..48e075c2d6 100644 --- a/esphome/components/radon_eye_rd200/radon_eye_rd200.h +++ b/esphome/components/radon_eye_rd200/radon_eye_rd200.h @@ -11,8 +11,7 @@ #include "esphome/core/component.h" #include "esphome/core/log.h" -namespace esphome { -namespace radon_eye_rd200 { +namespace esphome::radon_eye_rd200 { class RadonEyeRD200 : public PollingComponent, public ble_client::BLEClientNode { public: @@ -41,7 +40,6 @@ class RadonEyeRD200 : public PollingComponent, public ble_client::BLEClientNode esp32_ble_tracker::ESPBTUUID sensors_read_characteristic_uuid_; }; -} // namespace radon_eye_rd200 -} // namespace esphome +} // namespace esphome::radon_eye_rd200 #endif // USE_ESP32 diff --git a/esphome/components/rc522/rc522.cpp b/esphome/components/rc522/rc522.cpp index c5f7ec2cd4..7c1b6ae314 100644 --- a/esphome/components/rc522/rc522.cpp +++ b/esphome/components/rc522/rc522.cpp @@ -5,8 +5,7 @@ // Based on: // - https://github.com/miguelbalboa/rfid -namespace esphome { -namespace rc522 { +namespace esphome::rc522 { static const uint8_t WAIT_I_RQ = 0x30; // RxIRq and IdleIRq @@ -498,5 +497,4 @@ void RC522Trigger::process(std::vector &data) { this->trigger(format_hex_pretty_to(uid_buf, data.data(), data.size(), '-')); } -} // namespace rc522 -} // namespace esphome +} // namespace esphome::rc522 diff --git a/esphome/components/rc522/rc522.h b/esphome/components/rc522/rc522.h index 437cea808b..45473e04b0 100644 --- a/esphome/components/rc522/rc522.h +++ b/esphome/components/rc522/rc522.h @@ -7,8 +7,7 @@ #include -namespace esphome { -namespace rc522 { +namespace esphome::rc522 { class RC522BinarySensor; class RC522Trigger; @@ -275,5 +274,4 @@ class RC522Trigger : public Trigger { void process(std::vector &data); }; -} // namespace rc522 -} // namespace esphome +} // namespace esphome::rc522 diff --git a/esphome/components/rc522_i2c/rc522_i2c.cpp b/esphome/components/rc522_i2c/rc522_i2c.cpp index 6a3d8d2486..dbc86ff8e7 100644 --- a/esphome/components/rc522_i2c/rc522_i2c.cpp +++ b/esphome/components/rc522_i2c/rc522_i2c.cpp @@ -1,8 +1,7 @@ #include "rc522_i2c.h" #include "esphome/core/log.h" -namespace esphome { -namespace rc522_i2c { +namespace esphome::rc522_i2c { static const char *const TAG = "rc522_i2c"; @@ -66,5 +65,4 @@ void RC522I2C::pcd_write_register(PcdRegister reg, ///< The register to write t write_bytes(reg >> 1, values, count); } -} // namespace rc522_i2c -} // namespace esphome +} // namespace esphome::rc522_i2c diff --git a/esphome/components/rc522_i2c/rc522_i2c.h b/esphome/components/rc522_i2c/rc522_i2c.h index 8d8b0a0716..bd6f2269d8 100644 --- a/esphome/components/rc522_i2c/rc522_i2c.h +++ b/esphome/components/rc522_i2c/rc522_i2c.h @@ -4,8 +4,7 @@ #include "esphome/components/rc522/rc522.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace rc522_i2c { +namespace esphome::rc522_i2c { class RC522I2C : public rc522::RC522, public i2c::I2CDevice { public: @@ -38,5 +37,4 @@ class RC522I2C : public rc522::RC522, public i2c::I2CDevice { ) override; }; -} // namespace rc522_i2c -} // namespace esphome +} // namespace esphome::rc522_i2c diff --git a/esphome/components/rc522_spi/rc522_spi.cpp b/esphome/components/rc522_spi/rc522_spi.cpp index 40da449814..b63ad1cfdc 100644 --- a/esphome/components/rc522_spi/rc522_spi.cpp +++ b/esphome/components/rc522_spi/rc522_spi.cpp @@ -5,8 +5,7 @@ // Based on: // - https://github.com/miguelbalboa/rfid -namespace esphome { -namespace rc522_spi { +namespace esphome::rc522_spi { static const char *const TAG = "rc522_spi"; @@ -136,5 +135,4 @@ void RC522Spi::pcd_write_register(PcdRegister reg, ///< The register to write t ESP_LOGVV(TAG, "write_register_(%d, %d) -> %s", reg, count, buf.c_str()); } -} // namespace rc522_spi -} // namespace esphome +} // namespace esphome::rc522_spi diff --git a/esphome/components/rc522_spi/rc522_spi.h b/esphome/components/rc522_spi/rc522_spi.h index 0ccbcd7588..54caf5c117 100644 --- a/esphome/components/rc522_spi/rc522_spi.h +++ b/esphome/components/rc522_spi/rc522_spi.h @@ -4,7 +4,6 @@ #include "esphome/components/rc522/rc522.h" #include "esphome/components/spi/spi.h" -namespace esphome { /** * Library based on https://github.com/miguelbalboa/rfid * and adapted to ESPHome by @glmnet @@ -13,7 +12,7 @@ namespace esphome { * * */ -namespace rc522_spi { +namespace esphome::rc522_spi { class RC522Spi : public rc522::RC522, public spi::SPIDevice #include -namespace esphome { -namespace rdm6300 { +namespace esphome::rdm6300 { class RDM6300BinarySensor; class RDM6300Trigger; @@ -52,5 +51,4 @@ class RDM6300Trigger : public Trigger { void process(uint32_t uid) { this->trigger(uid); } }; -} // namespace rdm6300 -} // namespace esphome +} // namespace esphome::rdm6300 diff --git a/esphome/components/remote_base/abbwelcome_protocol.cpp b/esphome/components/remote_base/abbwelcome_protocol.cpp index a67ca48dbe..2000148ca8 100644 --- a/esphome/components/remote_base/abbwelcome_protocol.cpp +++ b/esphome/components/remote_base/abbwelcome_protocol.cpp @@ -1,8 +1,7 @@ #include "abbwelcome_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.abbwelcome"; @@ -123,5 +122,4 @@ void ABBWelcomeProtocol::dump(const ABBWelcomeData &data) { ESP_LOGD(TAG, "Received ABBWelcome: %s", data.format_to(buf)); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/abbwelcome_protocol.h b/esphome/components/remote_base/abbwelcome_protocol.h index 66664a89f3..7ff32923be 100644 --- a/esphome/components/remote_base/abbwelcome_protocol.h +++ b/esphome/components/remote_base/abbwelcome_protocol.h @@ -8,8 +8,7 @@ #include #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static constexpr uint8_t MAX_DATA_LENGTH = 15; static constexpr uint8_t DATA_LENGTH_MASK = 0x3f; @@ -272,5 +271,4 @@ template class ABBWelcomeAction : public RemoteTransmitterAction } data_; }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/aeha_protocol.cpp b/esphome/components/remote_base/aeha_protocol.cpp index f40cff7623..69f91ba90e 100644 --- a/esphome/components/remote_base/aeha_protocol.cpp +++ b/esphome/components/remote_base/aeha_protocol.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.aeha"; @@ -98,5 +97,4 @@ void AEHAProtocol::dump(const AEHAData &data) { ESP_LOGI(TAG, "Received AEHA: address=0x%04X, data=[%s]", data.address, data_str.c_str()); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/aeha_protocol.h b/esphome/components/remote_base/aeha_protocol.h index 51718eefcb..3f4e98bd43 100644 --- a/esphome/components/remote_base/aeha_protocol.h +++ b/esphome/components/remote_base/aeha_protocol.h @@ -4,8 +4,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct AEHAData { uint16_t address; @@ -42,5 +41,4 @@ template class AEHAAction : public RemoteTransmitterActionBase -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.beo4"; @@ -149,5 +148,4 @@ void Beo4Protocol::dump(const Beo4Data &data) { ESP_LOGI(TAG, "Beo4: source=0x%02x command=0x%02x repeats=%d ", data.source, data.command, data.repeats); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/beo4_protocol.h b/esphome/components/remote_base/beo4_protocol.h index 445e792cbc..30b99dbeb7 100644 --- a/esphome/components/remote_base/beo4_protocol.h +++ b/esphome/components/remote_base/beo4_protocol.h @@ -4,8 +4,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct Beo4Data { uint8_t source; // beoSource, e.g. video, audio, light... @@ -39,5 +38,4 @@ template class Beo4Action : public RemoteTransmitterActionBase -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.byronsx"; @@ -135,5 +134,4 @@ void ByronSXProtocol::dump(const ByronSXData &data) { ESP_LOGD(TAG, "Received ByronSX: address=0x%08X, command=0x%02x", data.address, data.command); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/byronsx_protocol.h b/esphome/components/remote_base/byronsx_protocol.h index 5d23237ab1..674fa99ea1 100644 --- a/esphome/components/remote_base/byronsx_protocol.h +++ b/esphome/components/remote_base/byronsx_protocol.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct ByronSXData { uint8_t address; @@ -42,5 +41,4 @@ template class ByronSXAction : public RemoteTransmitterActionBas } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/canalsat_protocol.cpp b/esphome/components/remote_base/canalsat_protocol.cpp index 1468b66939..eafa98ebcc 100644 --- a/esphome/components/remote_base/canalsat_protocol.cpp +++ b/esphome/components/remote_base/canalsat_protocol.cpp @@ -1,8 +1,7 @@ #include "canalsat_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const CANALSAT_TAG = "remote.canalsat"; static const char *const CANALSATLD_TAG = "remote.canalsatld"; @@ -104,5 +103,4 @@ void CanalSatBaseProtocol::dump(const CanalSatData &data) { } } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/canalsat_protocol.h b/esphome/components/remote_base/canalsat_protocol.h index 180989ef99..5ba9115ea8 100644 --- a/esphome/components/remote_base/canalsat_protocol.h +++ b/esphome/components/remote_base/canalsat_protocol.h @@ -2,8 +2,7 @@ #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct CanalSatData { uint8_t device : 7; @@ -74,5 +73,4 @@ template class CanalSatLDAction : public RemoteTransmitterAction } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/coolix_protocol.cpp b/esphome/components/remote_base/coolix_protocol.cpp index 21a9f598b7..53e1d59f13 100644 --- a/esphome/components/remote_base/coolix_protocol.cpp +++ b/esphome/components/remote_base/coolix_protocol.cpp @@ -1,8 +1,7 @@ #include "coolix_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.coolix"; @@ -109,5 +108,4 @@ void CoolixProtocol::dump(const CoolixData &data) { } } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/coolix_protocol.h b/esphome/components/remote_base/coolix_protocol.h index b66415ff70..d9441e8417 100644 --- a/esphome/components/remote_base/coolix_protocol.h +++ b/esphome/components/remote_base/coolix_protocol.h @@ -6,8 +6,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct CoolixData { CoolixData() {} @@ -37,5 +36,4 @@ template class CoolixAction : public RemoteTransmitterActionBase } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/dish_protocol.cpp b/esphome/components/remote_base/dish_protocol.cpp index 69226101bf..9a6420afd5 100644 --- a/esphome/components/remote_base/dish_protocol.cpp +++ b/esphome/components/remote_base/dish_protocol.cpp @@ -1,8 +1,7 @@ #include "dish_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.dish"; @@ -90,5 +89,4 @@ void DishProtocol::dump(const DishData &data) { ESP_LOGI(TAG, "Received Dish: address=0x%02X, command=0x%02X", data.address, data.command); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/dish_protocol.h b/esphome/components/remote_base/dish_protocol.h index ca4d04ed34..c89f4e78e1 100644 --- a/esphome/components/remote_base/dish_protocol.h +++ b/esphome/components/remote_base/dish_protocol.h @@ -2,8 +2,7 @@ #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct DishData { uint8_t address; @@ -34,5 +33,4 @@ template class DishAction : public RemoteTransmitterActionBase -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct DooyaData { uint32_t id; @@ -45,5 +44,4 @@ template class DooyaAction : public RemoteTransmitterActionBase< } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/drayton_protocol.cpp b/esphome/components/remote_base/drayton_protocol.cpp index 946bd9cacb..2261bd04e9 100644 --- a/esphome/components/remote_base/drayton_protocol.cpp +++ b/esphome/components/remote_base/drayton_protocol.cpp @@ -3,8 +3,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.drayton"; @@ -236,5 +235,4 @@ void DraytonProtocol::dump(const DraytonData &data) { ((data.address << 1) & 0xffff), data.channel, data.command); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/drayton_protocol.h b/esphome/components/remote_base/drayton_protocol.h index 75213b9186..693a1bbe85 100644 --- a/esphome/components/remote_base/drayton_protocol.h +++ b/esphome/components/remote_base/drayton_protocol.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct DraytonData { uint16_t address; @@ -42,5 +41,4 @@ template class DraytonAction : public RemoteTransmitterActionBas } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/dyson_protocol.cpp b/esphome/components/remote_base/dyson_protocol.cpp index db4e1135f4..942b40d26f 100644 --- a/esphome/components/remote_base/dyson_protocol.cpp +++ b/esphome/components/remote_base/dyson_protocol.cpp @@ -3,8 +3,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.dyson"; @@ -67,5 +66,4 @@ void DysonProtocol::dump(const DysonData &data) { ESP_LOGI(TAG, "Dyson: code=0x%x rolling index=%d", data.code, data.index); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/dyson_protocol.h b/esphome/components/remote_base/dyson_protocol.h index d1c08fefba..3473a489b2 100644 --- a/esphome/components/remote_base/dyson_protocol.h +++ b/esphome/components/remote_base/dyson_protocol.h @@ -4,8 +4,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static constexpr uint8_t IGNORE_INDEX = 0xFF; @@ -42,5 +41,4 @@ template class DysonAction : public RemoteTransmitterActionBase< } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/gobox_protocol.cpp b/esphome/components/remote_base/gobox_protocol.cpp index 0e1617659d..1d67be86b8 100644 --- a/esphome/components/remote_base/gobox_protocol.cpp +++ b/esphome/components/remote_base/gobox_protocol.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.gobox"; @@ -128,5 +127,4 @@ void GoboxProtocol::dump(const GoboxData &data) { } } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/gobox_protocol.h b/esphome/components/remote_base/gobox_protocol.h index 7e18b61458..f6b278771e 100644 --- a/esphome/components/remote_base/gobox_protocol.h +++ b/esphome/components/remote_base/gobox_protocol.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct GoboxData { int code; @@ -50,5 +49,4 @@ template class GoboxAction : public RemoteTransmitterActionBase< } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/haier_protocol.cpp b/esphome/components/remote_base/haier_protocol.cpp index 734f3c7789..fa4cec773f 100644 --- a/esphome/components/remote_base/haier_protocol.cpp +++ b/esphome/components/remote_base/haier_protocol.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.haier"; @@ -84,5 +83,4 @@ void HaierProtocol::dump(const HaierData &data) { ESP_LOGI(TAG, "Received Haier: %s", format_hex_pretty_to(hex_buf, data.data.data(), data.data.size())); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/haier_protocol.h b/esphome/components/remote_base/haier_protocol.h index 7a4ee640e8..9c45ba1a63 100644 --- a/esphome/components/remote_base/haier_protocol.h +++ b/esphome/components/remote_base/haier_protocol.h @@ -3,8 +3,7 @@ #include "remote_base.h" #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct HaierData { std::vector data; @@ -35,5 +34,4 @@ template class HaierAction : public RemoteTransmitterActionBase< } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/jvc_protocol.cpp b/esphome/components/remote_base/jvc_protocol.cpp index c33cae7a48..86a47e757d 100644 --- a/esphome/components/remote_base/jvc_protocol.cpp +++ b/esphome/components/remote_base/jvc_protocol.cpp @@ -1,8 +1,7 @@ #include "jvc_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.jvc"; @@ -48,5 +47,4 @@ optional JVCProtocol::decode(RemoteReceiveData src) { } void JVCProtocol::dump(const JVCData &data) { ESP_LOGI(TAG, "Received JVC: data=0x%04" PRIX32, data.data); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/jvc_protocol.h b/esphome/components/remote_base/jvc_protocol.h index a17e593ad2..f6e2548dea 100644 --- a/esphome/components/remote_base/jvc_protocol.h +++ b/esphome/components/remote_base/jvc_protocol.h @@ -4,8 +4,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct JVCData { uint32_t data; @@ -33,5 +32,4 @@ template class JVCAction : public RemoteTransmitterActionBase -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.keeloq"; @@ -190,5 +189,4 @@ void KeeloqProtocol::dump(const KeeloqData &data) { ESP_LOGD(TAG, "Received Keeloq: address=0x%08" PRIx32 ", command=0x%02x", data.address, data.command); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/keeloq_protocol.h b/esphome/components/remote_base/keeloq_protocol.h index 47125c151b..432313b87b 100644 --- a/esphome/components/remote_base/keeloq_protocol.h +++ b/esphome/components/remote_base/keeloq_protocol.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct KeeloqData { uint32_t encrypted; // 32 bit encrypted field @@ -49,5 +48,4 @@ template class KeeloqAction : public RemoteTransmitterActionBase } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/lg_protocol.cpp b/esphome/components/remote_base/lg_protocol.cpp index 4c54ff00bd..e450659b42 100644 --- a/esphome/components/remote_base/lg_protocol.cpp +++ b/esphome/components/remote_base/lg_protocol.cpp @@ -1,8 +1,7 @@ #include "lg_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.lg"; @@ -54,5 +53,4 @@ void LGProtocol::dump(const LGData &data) { ESP_LOGI(TAG, "Received LG: data=0x%08" PRIX32 ", nbits=%d", data.data, data.nbits); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/lg_protocol.h b/esphome/components/remote_base/lg_protocol.h index e0039d033d..9715974995 100644 --- a/esphome/components/remote_base/lg_protocol.h +++ b/esphome/components/remote_base/lg_protocol.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct LGData { uint32_t data; @@ -37,5 +36,4 @@ template class LGAction : public RemoteTransmitterActionBase class MagiQuestAction : public RemoteTransmitterActionB } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/midea_protocol.cpp b/esphome/components/remote_base/midea_protocol.cpp index 4fa717cf08..6889c5d9b4 100644 --- a/esphome/components/remote_base/midea_protocol.cpp +++ b/esphome/components/remote_base/midea_protocol.cpp @@ -1,8 +1,7 @@ #include "midea_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.midea"; @@ -75,5 +74,4 @@ void MideaProtocol::dump(const MideaData &data) { ESP_LOGI(TAG, "Received Midea: %s", data.to_str(buf)); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/midea_protocol.h b/esphome/components/remote_base/midea_protocol.h index 334e8a7cb3..f21dd40828 100644 --- a/esphome/components/remote_base/midea_protocol.h +++ b/esphome/components/remote_base/midea_protocol.h @@ -7,8 +7,7 @@ #include "esphome/core/helpers.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { class MideaData { public: @@ -88,5 +87,4 @@ template class MideaAction : public RemoteTransmitterActionBase< } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/mirage_protocol.cpp b/esphome/components/remote_base/mirage_protocol.cpp index 2ae877f193..380cfaecb2 100644 --- a/esphome/components/remote_base/mirage_protocol.cpp +++ b/esphome/components/remote_base/mirage_protocol.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.mirage"; @@ -85,5 +84,4 @@ void MirageProtocol::dump(const MirageData &data) { ESP_LOGI(TAG, "Received Mirage: %s", format_hex_pretty_to(hex_buf, data.data.data(), data.data.size())); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/mirage_protocol.h b/esphome/components/remote_base/mirage_protocol.h index 4257f7fa00..c967e72f13 100644 --- a/esphome/components/remote_base/mirage_protocol.h +++ b/esphome/components/remote_base/mirage_protocol.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct MirageData { std::vector data; @@ -35,5 +34,4 @@ template class MirageAction : public RemoteTransmitterActionBase } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/nec_protocol.cpp b/esphome/components/remote_base/nec_protocol.cpp index 062f81b4d6..e639248b4e 100644 --- a/esphome/components/remote_base/nec_protocol.cpp +++ b/esphome/components/remote_base/nec_protocol.cpp @@ -1,8 +1,7 @@ #include "nec_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.nec"; @@ -98,5 +97,4 @@ void NECProtocol::dump(const NECData &data) { data.command_repeats); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/nec_protocol.h b/esphome/components/remote_base/nec_protocol.h index 71e1bccba8..7b310e8ba5 100644 --- a/esphome/components/remote_base/nec_protocol.h +++ b/esphome/components/remote_base/nec_protocol.h @@ -2,8 +2,7 @@ #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct NECData { uint16_t address; @@ -37,5 +36,4 @@ template class NECAction : public RemoteTransmitterActionBase -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct NexaData { uint32_t device; @@ -50,5 +49,4 @@ template class NexaAction : public RemoteTransmitterActionBase -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct PanasonicData { uint16_t address; @@ -37,5 +36,4 @@ template class PanasonicAction : public RemoteTransmitterActionB } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/pioneer_protocol.cpp b/esphome/components/remote_base/pioneer_protocol.cpp index f350ef66ae..f4d6aa4026 100644 --- a/esphome/components/remote_base/pioneer_protocol.cpp +++ b/esphome/components/remote_base/pioneer_protocol.cpp @@ -1,8 +1,7 @@ #include "pioneer_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.pioneer"; @@ -152,5 +151,4 @@ void PioneerProtocol::dump(const PioneerData &data) { } } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/pioneer_protocol.h b/esphome/components/remote_base/pioneer_protocol.h index 4cac4f9f32..514ab67501 100644 --- a/esphome/components/remote_base/pioneer_protocol.h +++ b/esphome/components/remote_base/pioneer_protocol.h @@ -2,8 +2,7 @@ #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct PioneerData { uint16_t rc_code_1; @@ -34,5 +33,4 @@ template class PioneerAction : public RemoteTransmitterActionBas } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/pronto_protocol.cpp b/esphome/components/remote_base/pronto_protocol.cpp index 6903cd4605..dc128d4622 100644 --- a/esphome/components/remote_base/pronto_protocol.cpp +++ b/esphome/components/remote_base/pronto_protocol.cpp @@ -35,8 +35,7 @@ #include "pronto_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.pronto"; @@ -243,5 +242,4 @@ void ProntoProtocol::dump(const ProntoData &data) { } while (remaining > 0); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/pronto_protocol.h b/esphome/components/remote_base/pronto_protocol.h index e600834d1a..f4f6b2144d 100644 --- a/esphome/components/remote_base/pronto_protocol.h +++ b/esphome/components/remote_base/pronto_protocol.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { std::vector encode_pronto(const std::string &str); @@ -51,5 +50,4 @@ template class ProntoAction : public RemoteTransmitterActionBase } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/raw_protocol.cpp b/esphome/components/remote_base/raw_protocol.cpp index 7e6be3b77e..02c2916849 100644 --- a/esphome/components/remote_base/raw_protocol.cpp +++ b/esphome/components/remote_base/raw_protocol.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.raw"; @@ -38,5 +37,4 @@ bool RawDumper::dump(RemoteReceiveData src) { return true; } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/raw_protocol.h b/esphome/components/remote_base/raw_protocol.h index 941b6aab42..1bcf390b62 100644 --- a/esphome/components/remote_base/raw_protocol.h +++ b/esphome/components/remote_base/raw_protocol.h @@ -6,8 +6,7 @@ #include #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { class RawBinarySensor : public RemoteReceiverBinarySensorBase { public: @@ -82,5 +81,4 @@ class RawDumper : public RemoteReceiverDumperBase { bool is_secondary() override { return true; } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/rc5_protocol.cpp b/esphome/components/remote_base/rc5_protocol.cpp index bb6d382d80..c7f79ad84a 100644 --- a/esphome/components/remote_base/rc5_protocol.cpp +++ b/esphome/components/remote_base/rc5_protocol.cpp @@ -1,8 +1,7 @@ #include "rc5_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.rc5"; @@ -86,5 +85,4 @@ void RC5Protocol::dump(const RC5Data &data) { ESP_LOGI(TAG, "Received RC5: address=0x%02X, command=0x%02X", data.address, data.command); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/rc5_protocol.h b/esphome/components/remote_base/rc5_protocol.h index 589c8d42de..dbb89e41c6 100644 --- a/esphome/components/remote_base/rc5_protocol.h +++ b/esphome/components/remote_base/rc5_protocol.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct RC5Data { uint8_t address; @@ -35,5 +34,4 @@ template class RC5Action : public RemoteTransmitterActionBase class RC6Action : public RemoteTransmitterActionBase; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/remote_base.cpp b/esphome/components/remote_base/remote_base.cpp index b4a549f0be..4d9bc55f21 100644 --- a/esphome/components/remote_base/remote_base.cpp +++ b/esphome/components/remote_base/remote_base.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote_base"; @@ -198,5 +197,4 @@ void RemoteTransmitterBase::send_(uint32_t send_times, uint32_t send_wait) { #endif this->send_internal(send_times, send_wait); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/remote_base.h b/esphome/components/remote_base/remote_base.h index e5e923d780..0b1109267f 100644 --- a/esphome/components/remote_base/remote_base.h +++ b/esphome/components/remote_base/remote_base.h @@ -8,8 +8,7 @@ #include "esphome/core/component.h" #include "esphome/core/hal.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { enum ToleranceMode : uint8_t { TOLERANCE_MODE_PERCENTAGE = 0, @@ -317,5 +316,4 @@ template class RemoteReceiverDumper : public RemoteReceiverDumperBas using prefix##Dumper = RemoteReceiverDumper; #define DECLARE_REMOTE_PROTOCOL(prefix) DECLARE_REMOTE_PROTOCOL_(prefix) -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/roomba_protocol.cpp b/esphome/components/remote_base/roomba_protocol.cpp index 6b7d216374..8053792a60 100644 --- a/esphome/components/remote_base/roomba_protocol.cpp +++ b/esphome/components/remote_base/roomba_protocol.cpp @@ -1,8 +1,7 @@ #include "roomba_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.roomba"; @@ -52,5 +51,4 @@ optional RoombaProtocol::decode(RemoteReceiveData src) { } void RoombaProtocol::dump(const RoombaData &data) { ESP_LOGD(TAG, "Received Roomba: data=0x%02X", data.data); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/roomba_protocol.h b/esphome/components/remote_base/roomba_protocol.h index f94cb7df1b..3582dac398 100644 --- a/esphome/components/remote_base/roomba_protocol.h +++ b/esphome/components/remote_base/roomba_protocol.h @@ -2,8 +2,7 @@ #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct RoombaData { uint8_t data; @@ -31,5 +30,4 @@ template class RoombaAction : public RemoteTransmitterActionBase } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/samsung36_protocol.cpp b/esphome/components/remote_base/samsung36_protocol.cpp index 10e8bd2d01..ded8c71aa3 100644 --- a/esphome/components/remote_base/samsung36_protocol.cpp +++ b/esphome/components/remote_base/samsung36_protocol.cpp @@ -1,8 +1,7 @@ #include "samsung36_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.samsung36"; @@ -99,5 +98,4 @@ void Samsung36Protocol::dump(const Samsung36Data &data) { ESP_LOGI(TAG, "Received Samsung36: address=0x%04X, command=0x%08" PRIX32, data.address, data.command); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/samsung36_protocol.h b/esphome/components/remote_base/samsung36_protocol.h index aa7fd21609..4f15d906e7 100644 --- a/esphome/components/remote_base/samsung36_protocol.h +++ b/esphome/components/remote_base/samsung36_protocol.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct Samsung36Data { uint16_t address; @@ -37,5 +36,4 @@ template class Samsung36Action : public RemoteTransmitterActionB } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/samsung_protocol.cpp b/esphome/components/remote_base/samsung_protocol.cpp index 2a48cbb918..7190e97403 100644 --- a/esphome/components/remote_base/samsung_protocol.cpp +++ b/esphome/components/remote_base/samsung_protocol.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.samsung"; @@ -61,5 +60,4 @@ void SamsungProtocol::dump(const SamsungData &data) { ESP_LOGI(TAG, "Received Samsung: data=0x%" PRIX64 ", nbits=%d", data.data, data.nbits); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/samsung_protocol.h b/esphome/components/remote_base/samsung_protocol.h index 41434f2889..bb234d681d 100644 --- a/esphome/components/remote_base/samsung_protocol.h +++ b/esphome/components/remote_base/samsung_protocol.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct SamsungData { uint64_t data; @@ -35,5 +34,4 @@ template class SamsungAction : public RemoteTransmitterActionBas } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/sony_protocol.cpp b/esphome/components/remote_base/sony_protocol.cpp index 504b346925..0abb7fc0e0 100644 --- a/esphome/components/remote_base/sony_protocol.cpp +++ b/esphome/components/remote_base/sony_protocol.cpp @@ -1,8 +1,7 @@ #include "sony_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.sony"; @@ -65,5 +64,4 @@ void SonyProtocol::dump(const SonyData &data) { ESP_LOGI(TAG, "Received Sony: data=0x%08" PRIX32 ", nbits=%d", data.data, data.nbits); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/sony_protocol.h b/esphome/components/remote_base/sony_protocol.h index d9e4f37d53..eb873e8b7d 100644 --- a/esphome/components/remote_base/sony_protocol.h +++ b/esphome/components/remote_base/sony_protocol.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct SonyData { uint32_t data; @@ -37,5 +36,4 @@ template class SonyAction : public RemoteTransmitterActionBase -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.symphony"; @@ -118,5 +117,4 @@ void SymphonyProtocol::dump(const SymphonyData &data) { ESP_LOGI(TAG, "Received Symphony: data=0x%0*" PRIX32 ", nbits=%" PRIu8, hex_width, (uint32_t) data.data, data.nbits); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/symphony_protocol.h b/esphome/components/remote_base/symphony_protocol.h index 7e77a268ba..7caf5eab86 100644 --- a/esphome/components/remote_base/symphony_protocol.h +++ b/esphome/components/remote_base/symphony_protocol.h @@ -5,8 +5,7 @@ #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct SymphonyData { uint32_t data; @@ -40,5 +39,4 @@ template class SymphonyAction : public RemoteTransmitterActionBa } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/toshiba_ac_protocol.cpp b/esphome/components/remote_base/toshiba_ac_protocol.cpp index a20a29b84a..077b4340fa 100644 --- a/esphome/components/remote_base/toshiba_ac_protocol.cpp +++ b/esphome/components/remote_base/toshiba_ac_protocol.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.toshibaac"; @@ -111,5 +110,4 @@ void ToshibaAcProtocol::dump(const ToshibaAcData &data) { } } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/toshiba_ac_protocol.h b/esphome/components/remote_base/toshiba_ac_protocol.h index c69401c378..8a853005ac 100644 --- a/esphome/components/remote_base/toshiba_ac_protocol.h +++ b/esphome/components/remote_base/toshiba_ac_protocol.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct ToshibaAcData { uint64_t rc_code_1; @@ -35,5 +34,4 @@ template class ToshibaAcAction : public RemoteTransmitterActionB } }; -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/toto_protocol.cpp b/esphome/components/remote_base/toto_protocol.cpp index f08258c4a3..042efcbc36 100644 --- a/esphome/components/remote_base/toto_protocol.cpp +++ b/esphome/components/remote_base/toto_protocol.cpp @@ -1,8 +1,7 @@ #include "toto_protocol.h" #include "esphome/core/log.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { static const char *const TAG = "remote.toto"; @@ -96,5 +95,4 @@ void TotoProtocol::dump(const TotoData &data) { data.rc_code_2, data.command); } -} // namespace remote_base -} // namespace esphome +} // namespace esphome::remote_base diff --git a/esphome/components/remote_base/toto_protocol.h b/esphome/components/remote_base/toto_protocol.h index 53d453f7e3..285c9f2125 100644 --- a/esphome/components/remote_base/toto_protocol.h +++ b/esphome/components/remote_base/toto_protocol.h @@ -2,8 +2,7 @@ #include "remote_base.h" -namespace esphome { -namespace remote_base { +namespace esphome::remote_base { struct TotoData { uint8_t rc_code_1 : 4; @@ -39,5 +38,4 @@ template class TotoAction : public RemoteTransmitterActionBase #include -namespace esphome { -namespace resampler { +namespace esphome::resampler { static const UBaseType_t RESAMPLER_TASK_PRIORITY = 1; @@ -373,7 +372,6 @@ void ResamplerSpeaker::resample_task(void *params) { vTaskSuspend(nullptr); // Suspend this task indefinitely until the loop method deletes it } -} // namespace resampler -} // namespace esphome +} // namespace esphome::resampler #endif diff --git a/esphome/components/resampler/speaker/resampler_speaker.h b/esphome/components/resampler/speaker/resampler_speaker.h index cdbc1c22db..36f39fda97 100644 --- a/esphome/components/resampler/speaker/resampler_speaker.h +++ b/esphome/components/resampler/speaker/resampler_speaker.h @@ -11,8 +11,7 @@ #include -namespace esphome { -namespace resampler { +namespace esphome::resampler { class ResamplerSpeaker : public Component, public speaker::Speaker { public: @@ -99,7 +98,6 @@ class ResamplerSpeaker : public Component, public speaker::Speaker { uint64_t callback_remainder_{0}; }; -} // namespace resampler -} // namespace esphome +} // namespace esphome::resampler #endif diff --git a/esphome/components/resistance/resistance_sensor.cpp b/esphome/components/resistance/resistance_sensor.cpp index 706a059de3..6056509093 100644 --- a/esphome/components/resistance/resistance_sensor.cpp +++ b/esphome/components/resistance/resistance_sensor.cpp @@ -1,8 +1,7 @@ #include "resistance_sensor.h" #include "esphome/core/log.h" -namespace esphome { -namespace resistance { +namespace esphome::resistance { static const char *const TAG = "resistance"; @@ -43,5 +42,4 @@ void ResistanceSensor::process_(float value) { this->publish_state(res); } -} // namespace resistance -} // namespace esphome +} // namespace esphome::resistance diff --git a/esphome/components/resistance/resistance_sensor.h b/esphome/components/resistance/resistance_sensor.h index a3b6e92c59..b646fb509a 100644 --- a/esphome/components/resistance/resistance_sensor.h +++ b/esphome/components/resistance/resistance_sensor.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "esphome/components/sensor/sensor.h" -namespace esphome { -namespace resistance { +namespace esphome::resistance { enum ResistanceConfiguration { UPSTREAM, @@ -33,5 +32,4 @@ class ResistanceSensor : public Component, public sensor::Sensor { float reference_voltage_; }; -} // namespace resistance -} // namespace esphome +} // namespace esphome::resistance diff --git a/esphome/components/restart/button/restart_button.cpp b/esphome/components/restart/button/restart_button.cpp index accb1a8356..d6404315ea 100644 --- a/esphome/components/restart/button/restart_button.cpp +++ b/esphome/components/restart/button/restart_button.cpp @@ -3,8 +3,7 @@ #include "esphome/core/hal.h" #include "esphome/core/log.h" -namespace esphome { -namespace restart { +namespace esphome::restart { static const char *const TAG = "restart.button"; @@ -16,5 +15,4 @@ void RestartButton::press_action() { } void RestartButton::dump_config() { LOG_BUTTON("", "Restart Button", this); } -} // namespace restart -} // namespace esphome +} // namespace esphome::restart diff --git a/esphome/components/restart/button/restart_button.h b/esphome/components/restart/button/restart_button.h index fd51282d36..974db0cec4 100644 --- a/esphome/components/restart/button/restart_button.h +++ b/esphome/components/restart/button/restart_button.h @@ -3,8 +3,7 @@ #include "esphome/components/button/button.h" #include "esphome/core/component.h" -namespace esphome { -namespace restart { +namespace esphome::restart { class RestartButton final : public button::Button, public Component { public: @@ -14,5 +13,4 @@ class RestartButton final : public button::Button, public Component { void press_action() override; }; -} // namespace restart -} // namespace esphome +} // namespace esphome::restart diff --git a/esphome/components/restart/switch/restart_switch.cpp b/esphome/components/restart/switch/restart_switch.cpp index 422e85f4cd..96a4fc40f5 100644 --- a/esphome/components/restart/switch/restart_switch.cpp +++ b/esphome/components/restart/switch/restart_switch.cpp @@ -3,8 +3,7 @@ #include "esphome/core/log.h" #include "esphome/core/application.h" -namespace esphome { -namespace restart { +namespace esphome::restart { static const char *const TAG = "restart"; @@ -21,5 +20,4 @@ void RestartSwitch::write_state(bool state) { } void RestartSwitch::dump_config() { LOG_SWITCH("", "Restart Switch", this); } -} // namespace restart -} // namespace esphome +} // namespace esphome::restart diff --git a/esphome/components/restart/switch/restart_switch.h b/esphome/components/restart/switch/restart_switch.h index 7f1902ab53..67b4a2bfd1 100644 --- a/esphome/components/restart/switch/restart_switch.h +++ b/esphome/components/restart/switch/restart_switch.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "esphome/components/switch/switch.h" -namespace esphome { -namespace restart { +namespace esphome::restart { class RestartSwitch : public switch_::Switch, public Component { public: @@ -14,5 +13,4 @@ class RestartSwitch : public switch_::Switch, public Component { void write_state(bool state) override; }; -} // namespace restart -} // namespace esphome +} // namespace esphome::restart diff --git a/esphome/components/rf_bridge/rf_bridge.cpp b/esphome/components/rf_bridge/rf_bridge.cpp index 5ca629c12b..cec32e0406 100644 --- a/esphome/components/rf_bridge/rf_bridge.cpp +++ b/esphome/components/rf_bridge/rf_bridge.cpp @@ -5,8 +5,7 @@ #include #include -namespace esphome { -namespace rf_bridge { +namespace esphome::rf_bridge { static const char *const TAG = "rf_bridge"; @@ -243,5 +242,4 @@ void RFBridgeComponent::beep(uint16_t ms) { this->flush(); } -} // namespace rf_bridge -} // namespace esphome +} // namespace esphome::rf_bridge diff --git a/esphome/components/rf_bridge/rf_bridge.h b/esphome/components/rf_bridge/rf_bridge.h index 571ac6c385..2f91459076 100644 --- a/esphome/components/rf_bridge/rf_bridge.h +++ b/esphome/components/rf_bridge/rf_bridge.h @@ -7,8 +7,7 @@ #include "esphome/components/uart/uart.h" #include "esphome/core/automation.h" -namespace esphome { -namespace rf_bridge { +namespace esphome::rf_bridge { static const uint8_t RF_MESSAGE_SIZE = 9; static const uint8_t RF_CODE_START = 0xAA; @@ -179,5 +178,4 @@ template class RFBridgeBeepAction : public Action { RFBridgeComponent *parent_; }; -} // namespace rf_bridge -} // namespace esphome +} // namespace esphome::rf_bridge diff --git a/esphome/components/rgb/rgb_light_output.h b/esphome/components/rgb/rgb_light_output.h index 783187667a..f0d599cf57 100644 --- a/esphome/components/rgb/rgb_light_output.h +++ b/esphome/components/rgb/rgb_light_output.h @@ -4,8 +4,7 @@ #include "esphome/components/output/float_output.h" #include "esphome/components/light/light_output.h" -namespace esphome { -namespace rgb { +namespace esphome::rgb { class RGBLightOutput : public light::LightOutput { public: @@ -32,5 +31,4 @@ class RGBLightOutput : public light::LightOutput { output::FloatOutput *blue_; }; -} // namespace rgb -} // namespace esphome +} // namespace esphome::rgb diff --git a/esphome/components/rgbct/rgbct_light_output.h b/esphome/components/rgbct/rgbct_light_output.h index 9e23f783ae..84ecb232cc 100644 --- a/esphome/components/rgbct/rgbct_light_output.h +++ b/esphome/components/rgbct/rgbct_light_output.h @@ -5,8 +5,7 @@ #include "esphome/components/output/float_output.h" #include "esphome/core/component.h" -namespace esphome { -namespace rgbct { +namespace esphome::rgbct { class RGBCTLightOutput : public light::LightOutput { public: @@ -55,5 +54,4 @@ class RGBCTLightOutput : public light::LightOutput { bool color_interlock_{true}; }; -} // namespace rgbct -} // namespace esphome +} // namespace esphome::rgbct diff --git a/esphome/components/rgbw/rgbw_light_output.h b/esphome/components/rgbw/rgbw_light_output.h index 140726a43c..ae96eb2024 100644 --- a/esphome/components/rgbw/rgbw_light_output.h +++ b/esphome/components/rgbw/rgbw_light_output.h @@ -4,8 +4,7 @@ #include "esphome/components/output/float_output.h" #include "esphome/components/light/light_output.h" -namespace esphome { -namespace rgbw { +namespace esphome::rgbw { class RGBWLightOutput : public light::LightOutput { public: @@ -40,5 +39,4 @@ class RGBWLightOutput : public light::LightOutput { bool color_interlock_{false}; }; -} // namespace rgbw -} // namespace esphome +} // namespace esphome::rgbw diff --git a/esphome/components/rgbww/rgbww_light_output.h b/esphome/components/rgbww/rgbww_light_output.h index 9687360059..de5ee993f8 100644 --- a/esphome/components/rgbww/rgbww_light_output.h +++ b/esphome/components/rgbww/rgbww_light_output.h @@ -4,8 +4,7 @@ #include "esphome/components/output/float_output.h" #include "esphome/components/light/light_output.h" -namespace esphome { -namespace rgbww { +namespace esphome::rgbww { class RGBWWLightOutput : public light::LightOutput { public: @@ -51,5 +50,4 @@ class RGBWWLightOutput : public light::LightOutput { bool color_interlock_{false}; }; -} // namespace rgbww -} // namespace esphome +} // namespace esphome::rgbww diff --git a/esphome/components/rotary_encoder/rotary_encoder.cpp b/esphome/components/rotary_encoder/rotary_encoder.cpp index 38fd14375d..0831822d86 100644 --- a/esphome/components/rotary_encoder/rotary_encoder.cpp +++ b/esphome/components/rotary_encoder/rotary_encoder.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace rotary_encoder { +namespace esphome::rotary_encoder { static const char *const TAG = "rotary_encoder"; @@ -242,5 +241,4 @@ void RotaryEncoderSensor::set_resolution(RotaryEncoderResolution mode) { this->s void RotaryEncoderSensor::set_min_value(int32_t min_value) { this->store_.min_value = min_value; } void RotaryEncoderSensor::set_max_value(int32_t max_value) { this->store_.max_value = max_value; } -} // namespace rotary_encoder -} // namespace esphome +} // namespace esphome::rotary_encoder diff --git a/esphome/components/rotary_encoder/rotary_encoder.h b/esphome/components/rotary_encoder/rotary_encoder.h index 6f4a4fd83c..8a56da4fe2 100644 --- a/esphome/components/rotary_encoder/rotary_encoder.h +++ b/esphome/components/rotary_encoder/rotary_encoder.h @@ -7,8 +7,7 @@ #include "esphome/core/automation.h" #include "esphome/components/sensor/sensor.h" -namespace esphome { -namespace rotary_encoder { +namespace esphome::rotary_encoder { /// All possible restore modes for the rotary encoder enum RotaryEncoderRestoreMode { @@ -118,5 +117,4 @@ template class RotaryEncoderSetValueAction : public Action humidity; @@ -31,7 +30,6 @@ class RuuviListener : public esp32_ble_tracker::ESPBTDeviceListener { bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override; }; -} // namespace ruuvi_ble -} // namespace esphome +} // namespace esphome::ruuvi_ble #endif diff --git a/esphome/components/ruuvitag/ruuvitag.cpp b/esphome/components/ruuvitag/ruuvitag.cpp index 9b462b4794..99c6b8ae26 100644 --- a/esphome/components/ruuvitag/ruuvitag.cpp +++ b/esphome/components/ruuvitag/ruuvitag.cpp @@ -3,8 +3,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace ruuvitag { +namespace esphome::ruuvitag { static const char *const TAG = "ruuvitag"; @@ -23,7 +22,6 @@ void RuuviTag::dump_config() { LOG_SENSOR(" ", "Measurement Sequence Number", this->measurement_sequence_number_); } -} // namespace ruuvitag -} // namespace esphome +} // namespace esphome::ruuvitag #endif diff --git a/esphome/components/ruuvitag/ruuvitag.h b/esphome/components/ruuvitag/ruuvitag.h index dfe393724c..259675835d 100644 --- a/esphome/components/ruuvitag/ruuvitag.h +++ b/esphome/components/ruuvitag/ruuvitag.h @@ -7,8 +7,7 @@ #ifdef USE_ESP32 -namespace esphome { -namespace ruuvitag { +namespace esphome::ruuvitag { class RuuviTag : public Component, public esp32_ble_tracker::ESPBTDeviceListener { public: @@ -77,7 +76,6 @@ class RuuviTag : public Component, public esp32_ble_tracker::ESPBTDeviceListener sensor::Sensor *measurement_sequence_number_{nullptr}; }; -} // namespace ruuvitag -} // namespace esphome +} // namespace esphome::ruuvitag #endif diff --git a/esphome/components/rx8130/rx8130.cpp b/esphome/components/rx8130/rx8130.cpp index 0aa6e86d31..1b5b71f0e0 100644 --- a/esphome/components/rx8130/rx8130.cpp +++ b/esphome/components/rx8130/rx8130.cpp @@ -3,8 +3,7 @@ // https://download.epsondevice.com/td/pdf/app/RX8130CE_en.pdf -namespace esphome { -namespace rx8130 { +namespace esphome::rx8130 { static const uint8_t RX8130_REG_SEC = 0x10; static const uint8_t RX8130_REG_MIN = 0x11; @@ -121,5 +120,4 @@ void RX8130Component::stop_(bool stop) { } } -} // namespace rx8130 -} // namespace esphome +} // namespace esphome::rx8130 diff --git a/esphome/components/rx8130/rx8130.h b/esphome/components/rx8130/rx8130.h index 979da3e19c..152bd10f27 100644 --- a/esphome/components/rx8130/rx8130.h +++ b/esphome/components/rx8130/rx8130.h @@ -4,8 +4,7 @@ #include "esphome/components/i2c/i2c.h" #include "esphome/components/time/real_time_clock.h" -namespace esphome { -namespace rx8130 { +namespace esphome::rx8130 { class RX8130Component : public time::RealTimeClock, public i2c::I2CDevice { public: @@ -29,5 +28,4 @@ template class ReadAction : public Action, public Parente void play(const Ts... x) override { this->parent_->read_time(); } }; -} // namespace rx8130 -} // namespace esphome +} // namespace esphome::rx8130