mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 15:27:33 +00:00
[clang-tidy] Concatenate nested namespaces (1/7: components a-c) (#16294)
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace a01nyub {
|
||||
namespace esphome::a01nyub {
|
||||
|
||||
static const char *const TAG = "a01nyub.sensor";
|
||||
|
||||
@@ -42,5 +41,4 @@ void A01nyubComponent::check_buffer_() {
|
||||
|
||||
void A01nyubComponent::dump_config() { LOG_SENSOR("", "A01nyub Sensor", this); }
|
||||
|
||||
} // namespace a01nyub
|
||||
} // namespace esphome
|
||||
} // namespace esphome::a01nyub
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/components/uart/uart.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace a01nyub {
|
||||
namespace esphome::a01nyub {
|
||||
|
||||
class A01nyubComponent : public sensor::Sensor, public Component, public uart::UARTDevice {
|
||||
public:
|
||||
@@ -23,5 +22,4 @@ class A01nyubComponent : public sensor::Sensor, public Component, public uart::U
|
||||
std::vector<uint8_t> buffer_;
|
||||
};
|
||||
|
||||
} // namespace a01nyub
|
||||
} // namespace esphome
|
||||
} // namespace esphome::a01nyub
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace a02yyuw {
|
||||
namespace esphome::a02yyuw {
|
||||
|
||||
static const char *const TAG = "a02yyuw.sensor";
|
||||
|
||||
@@ -41,5 +40,4 @@ void A02yyuwComponent::check_buffer_() {
|
||||
|
||||
void A02yyuwComponent::dump_config() { LOG_SENSOR("", "A02yyuw Sensor", this); }
|
||||
|
||||
} // namespace a02yyuw
|
||||
} // namespace esphome
|
||||
} // namespace esphome::a02yyuw
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/components/uart/uart.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace a02yyuw {
|
||||
namespace esphome::a02yyuw {
|
||||
|
||||
class A02yyuwComponent : public sensor::Sensor, public Component, public uart::UARTDevice {
|
||||
public:
|
||||
@@ -23,5 +22,4 @@ class A02yyuwComponent : public sensor::Sensor, public Component, public uart::U
|
||||
std::vector<uint8_t> buffer_;
|
||||
};
|
||||
|
||||
} // namespace a02yyuw
|
||||
} // namespace esphome
|
||||
} // namespace esphome::a02yyuw
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "a4988.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace a4988 {
|
||||
namespace esphome::a4988 {
|
||||
|
||||
static const char *const TAG = "a4988.stepper";
|
||||
|
||||
@@ -51,5 +50,4 @@ void A4988::loop() {
|
||||
this->step_pin_->digital_write(false);
|
||||
}
|
||||
|
||||
} // namespace a4988
|
||||
} // namespace esphome
|
||||
} // namespace esphome::a4988
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/components/stepper/stepper.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace a4988 {
|
||||
namespace esphome::a4988 {
|
||||
|
||||
class A4988 : public stepper::Stepper, public Component {
|
||||
public:
|
||||
@@ -25,5 +24,4 @@ class A4988 : public stepper::Stepper, public Component {
|
||||
HighFrequencyLoopRequester high_freq_;
|
||||
};
|
||||
|
||||
} // namespace a4988
|
||||
} // namespace esphome
|
||||
} // namespace esphome::a4988
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "adalight_light_effect.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace adalight {
|
||||
namespace esphome::adalight {
|
||||
|
||||
static const char *const TAG = "adalight_light_effect";
|
||||
|
||||
@@ -138,5 +137,4 @@ AdalightLightEffect::Frame AdalightLightEffect::parse_frame_(light::AddressableL
|
||||
return CONSUMED;
|
||||
}
|
||||
|
||||
} // namespace adalight
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adalight
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace adalight {
|
||||
namespace esphome::adalight {
|
||||
|
||||
class AdalightLightEffect : public light::AddressableLightEffect, public uart::UARTDevice {
|
||||
public:
|
||||
@@ -35,5 +34,4 @@ class AdalightLightEffect : public light::AddressableLightEffect, public uart::U
|
||||
std::vector<uint8_t> frame_;
|
||||
};
|
||||
|
||||
} // namespace adalight
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adalight
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
#include <zephyr/drivers/adc.h>
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace adc {
|
||||
namespace esphome::adc {
|
||||
|
||||
#ifdef USE_ESP32
|
||||
// clang-format off
|
||||
@@ -162,5 +161,4 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace adc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adc
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "adc_sensor.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace adc {
|
||||
namespace esphome::adc {
|
||||
|
||||
static const char *const TAG = "adc.common";
|
||||
|
||||
@@ -79,5 +78,4 @@ void ADCSensor::set_sample_count(uint8_t sample_count) {
|
||||
|
||||
void ADCSensor::set_sampling_mode(SamplingMode sampling_mode) { this->sampling_mode_ = sampling_mode; }
|
||||
|
||||
} // namespace adc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adc
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
namespace adc {
|
||||
namespace esphome::adc {
|
||||
|
||||
static const char *const TAG = "adc.esp32";
|
||||
|
||||
@@ -364,7 +363,6 @@ float ADCSensor::sample_autorange_() {
|
||||
return final_result;
|
||||
}
|
||||
|
||||
} // namespace adc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adc
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "adc128s102.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace adc128s102 {
|
||||
namespace esphome::adc128s102 {
|
||||
|
||||
static const char *const TAG = "adc128s102";
|
||||
|
||||
@@ -28,5 +27,4 @@ uint16_t ADC128S102::read_data(uint8_t channel) {
|
||||
return digital_value;
|
||||
}
|
||||
|
||||
} // namespace adc128s102
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adc128s102
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/components/spi/spi.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace adc128s102 {
|
||||
namespace esphome::adc128s102 {
|
||||
|
||||
class ADC128S102 : public Component,
|
||||
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
|
||||
@@ -19,5 +18,4 @@ class ADC128S102 : public Component,
|
||||
uint16_t read_data(uint8_t channel);
|
||||
};
|
||||
|
||||
} // namespace adc128s102
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adc128s102
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace adc128s102 {
|
||||
namespace esphome::adc128s102 {
|
||||
|
||||
static const char *const TAG = "adc128s102.sensor";
|
||||
|
||||
@@ -18,5 +17,4 @@ void ADC128S102Sensor::dump_config() {
|
||||
float ADC128S102Sensor::sample() { return this->parent_->read_data(this->channel_); }
|
||||
void ADC128S102Sensor::update() { this->publish_state(this->sample()); }
|
||||
|
||||
} // namespace adc128s102
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adc128s102
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#include "../adc128s102.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace adc128s102 {
|
||||
namespace esphome::adc128s102 {
|
||||
|
||||
class ADC128S102Sensor : public PollingComponent,
|
||||
public Parented<ADC128S102>,
|
||||
@@ -24,5 +23,4 @@ class ADC128S102Sensor : public PollingComponent,
|
||||
protected:
|
||||
uint8_t channel_;
|
||||
};
|
||||
} // namespace adc128s102
|
||||
} // namespace esphome
|
||||
} // namespace esphome::adc128s102
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "addressable_light_display.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace addressable_light {
|
||||
namespace esphome::addressable_light {
|
||||
|
||||
static const char *const TAG = "addressable_light.display";
|
||||
|
||||
@@ -66,5 +65,4 @@ void HOT AddressableLightDisplay::draw_absolute_pixel_internal(int x, int y, Col
|
||||
this->addressable_light_buffer_[y * this->get_width_internal() + x] = color;
|
||||
}
|
||||
}
|
||||
} // namespace addressable_light
|
||||
} // namespace esphome
|
||||
} // namespace esphome::addressable_light
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace addressable_light {
|
||||
namespace esphome::addressable_light {
|
||||
|
||||
class AddressableLightDisplay : public display::DisplayBuffer {
|
||||
public:
|
||||
@@ -61,5 +60,4 @@ class AddressableLightDisplay : public display::DisplayBuffer {
|
||||
optional<uint32_t> last_effect_index_;
|
||||
optional<std::function<int(int, int)>> pixel_mapper_f_;
|
||||
};
|
||||
} // namespace addressable_light
|
||||
} // namespace esphome
|
||||
} // namespace esphome::addressable_light
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7880 {
|
||||
namespace esphome::ade7880 {
|
||||
|
||||
static const char *const TAG = "ade7880";
|
||||
|
||||
@@ -313,5 +312,4 @@ void ADE7880::reset_device_() {
|
||||
this->store_.reset_pending = true;
|
||||
}
|
||||
|
||||
} // namespace ade7880
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7880
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
#include "ade7880_registers.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7880 {
|
||||
namespace esphome::ade7880 {
|
||||
|
||||
struct NeutralChannel {
|
||||
void set_current(sensor::Sensor *sens) { this->current = sens; }
|
||||
@@ -125,5 +124,4 @@ class ADE7880 : public i2c::I2CDevice, public PollingComponent {
|
||||
void write_u32_register16_(uint16_t a_register, uint32_t value);
|
||||
};
|
||||
|
||||
} // namespace ade7880
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7880
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
#include "ade7880.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7880 {
|
||||
namespace esphome::ade7880 {
|
||||
|
||||
// adapted from https://stackoverflow.com/a/55912127/1886371
|
||||
template<size_t Bits, typename T> inline T sign_extend(const T &v) noexcept {
|
||||
@@ -97,5 +96,4 @@ void ADE7880::write_u32_register16_(uint16_t a_register, uint32_t value) {
|
||||
this->write_register16(a_register, reinterpret_cast<uint8_t *>(&out), sizeof(out));
|
||||
}
|
||||
|
||||
} // namespace ade7880
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7880
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
// Source: https://www.analog.com/media/en/technical-documentation/application-notes/AN-1127.pdf
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7880 {
|
||||
namespace esphome::ade7880 {
|
||||
|
||||
// DSP Data Memory RAM registers
|
||||
constexpr uint16_t AIGAIN = 0x4380;
|
||||
@@ -242,5 +241,4 @@ constexpr uint8_t DSPWP_SET_RO = (1 << 7);
|
||||
// DSPWP_SEL Register Bits
|
||||
constexpr uint8_t DSPWP_SEL_SET = 0xAD;
|
||||
|
||||
} // namespace ade7880
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7880
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7953_base {
|
||||
namespace esphome::ade7953_base {
|
||||
|
||||
static const char *const TAG = "ade7953";
|
||||
|
||||
@@ -160,5 +159,4 @@ void ADE7953::update() {
|
||||
ADE_PUBLISH(frequency, 223750.0f, 1 + val_16);
|
||||
}
|
||||
|
||||
} // namespace ade7953_base
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7953_base
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7953_base {
|
||||
namespace esphome::ade7953_base {
|
||||
|
||||
static constexpr uint8_t PGA_V_8 =
|
||||
0x007; // PGA_V, (R/W) Default: 0x00, Unsigned, Voltage channel gain configuration (Bits[2:0])
|
||||
@@ -131,5 +130,4 @@ class ADE7953 : public PollingComponent, public sensor::Sensor {
|
||||
virtual bool ade_read_32(uint16_t reg, uint32_t *value) = 0;
|
||||
};
|
||||
|
||||
} // namespace ade7953_base
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7953_base
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7953_i2c {
|
||||
namespace esphome::ade7953_i2c {
|
||||
|
||||
static const char *const TAG = "ade7953";
|
||||
|
||||
@@ -76,5 +75,4 @@ bool AdE7953I2c::ade_read_32(uint16_t reg, uint32_t *value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ade7953_i2c
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7953_i2c
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7953_i2c {
|
||||
namespace esphome::ade7953_i2c {
|
||||
|
||||
class AdE7953I2c : public ade7953_base::ADE7953, public i2c::I2CDevice {
|
||||
public:
|
||||
@@ -24,5 +23,4 @@ class AdE7953I2c : public ade7953_base::ADE7953, public i2c::I2CDevice {
|
||||
bool ade_read_32(uint16_t reg, uint32_t *value) override;
|
||||
};
|
||||
|
||||
} // namespace ade7953_i2c
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7953_i2c
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7953_spi {
|
||||
namespace esphome::ade7953_spi {
|
||||
|
||||
static const char *const TAG = "ade7953";
|
||||
|
||||
@@ -83,5 +82,4 @@ bool AdE7953Spi::ade_read_32(uint16_t reg, uint32_t *value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ade7953_spi
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7953_spi
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace ade7953_spi {
|
||||
namespace esphome::ade7953_spi {
|
||||
|
||||
class AdE7953Spi : public ade7953_base::ADE7953,
|
||||
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING,
|
||||
@@ -28,5 +27,4 @@ class AdE7953Spi : public ade7953_base::ADE7953,
|
||||
bool ade_read_32(uint16_t reg, uint32_t *value) override;
|
||||
};
|
||||
|
||||
} // namespace ade7953_spi
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ade7953_spi
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1115 {
|
||||
namespace esphome::ads1115 {
|
||||
|
||||
static const char *const TAG = "ads1115";
|
||||
static const uint8_t ADS1115_REGISTER_CONVERSION = 0x00;
|
||||
@@ -208,5 +207,4 @@ float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1
|
||||
return millivolts / 1e3f;
|
||||
}
|
||||
|
||||
} // namespace ads1115
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1115
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1115 {
|
||||
namespace esphome::ads1115 {
|
||||
|
||||
enum ADS1115Multiplexer {
|
||||
ADS1115_MULTIPLEXER_P0_N1 = 0b000,
|
||||
@@ -60,5 +59,4 @@ class ADS1115Component : public Component, public i2c::I2CDevice {
|
||||
bool continuous_mode_;
|
||||
};
|
||||
|
||||
} // namespace ads1115
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1115
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1115 {
|
||||
namespace esphome::ads1115 {
|
||||
|
||||
static const char *const TAG = "ads1115.sensor";
|
||||
|
||||
@@ -29,5 +28,4 @@ void ADS1115Sensor::dump_config() {
|
||||
this->multiplexer_, this->gain_, this->resolution_, this->samplerate_);
|
||||
}
|
||||
|
||||
} // namespace ads1115
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1115
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
#include "../ads1115.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1115 {
|
||||
namespace esphome::ads1115 {
|
||||
|
||||
/// Internal holder class that is in instance of Sensor so that the hub can create individual sensors.
|
||||
class ADS1115Sensor : public sensor::Sensor,
|
||||
@@ -33,5 +32,4 @@ class ADS1115Sensor : public sensor::Sensor,
|
||||
ADS1115Samplerate samplerate_;
|
||||
};
|
||||
|
||||
} // namespace ads1115
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1115
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1118 {
|
||||
namespace esphome::ads1118 {
|
||||
|
||||
static const char *const TAG = "ads1118";
|
||||
static const uint8_t ADS1118_DATA_RATE_860_SPS = 0b111;
|
||||
@@ -122,5 +121,4 @@ float ADS1118::request_measurement(ADS1118Multiplexer multiplexer, ADS1118Gain g
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ads1118
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1118
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/hal.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1118 {
|
||||
namespace esphome::ads1118 {
|
||||
|
||||
enum ADS1118Multiplexer {
|
||||
ADS1118_MULTIPLEXER_P0_N1 = 0b000,
|
||||
@@ -41,5 +40,4 @@ class ADS1118 : public Component,
|
||||
uint16_t config_{0};
|
||||
};
|
||||
|
||||
} // namespace ads1118
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1118
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1118 {
|
||||
namespace esphome::ads1118 {
|
||||
|
||||
static const char *const TAG = "ads1118.sensor";
|
||||
|
||||
@@ -27,5 +26,4 @@ void ADS1118Sensor::update() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ads1118
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1118
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
#include "../ads1118.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ads1118 {
|
||||
namespace esphome::ads1118 {
|
||||
|
||||
class ADS1118Sensor : public PollingComponent,
|
||||
public sensor::Sensor,
|
||||
@@ -32,5 +31,4 @@ class ADS1118Sensor : public PollingComponent,
|
||||
bool temperature_mode_;
|
||||
};
|
||||
|
||||
} // namespace ads1118
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ads1118
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
namespace ags10 {
|
||||
namespace esphome::ags10 {
|
||||
static const char *const TAG = "ags10";
|
||||
|
||||
// Data acquisition.
|
||||
@@ -192,5 +191,4 @@ template<size_t N> optional<std::array<uint8_t, N>> AGS10Component::read_and_che
|
||||
|
||||
return data;
|
||||
}
|
||||
} // namespace ags10
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ags10
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
#include "esphome/core/automation.h"
|
||||
#include "esphome/core/component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace ags10 {
|
||||
namespace esphome::ags10 {
|
||||
|
||||
class AGS10Component : public PollingComponent, public i2c::I2CDevice {
|
||||
public:
|
||||
@@ -136,5 +135,4 @@ template<typename... Ts> class AGS10SetZeroPointAction : public Action<Ts...>, p
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace ags10
|
||||
} // namespace esphome
|
||||
} // namespace esphome::ags10
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace aht10 {
|
||||
namespace esphome::aht10 {
|
||||
|
||||
static const char *const TAG = "aht10";
|
||||
static const uint8_t AHT10_INITIALIZE_CMD[] = {0xE1, 0x08, 0x00};
|
||||
@@ -160,5 +159,4 @@ void AHT10Component::dump_config() {
|
||||
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
||||
}
|
||||
|
||||
} // namespace aht10
|
||||
} // namespace esphome
|
||||
} // namespace esphome::aht10
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace aht10 {
|
||||
namespace esphome::aht10 {
|
||||
|
||||
enum AHT10Variant { AHT10, AHT20 };
|
||||
|
||||
@@ -31,5 +30,4 @@ class AHT10Component : public PollingComponent, public i2c::I2CDevice {
|
||||
uint32_t start_time_{};
|
||||
};
|
||||
|
||||
} // namespace aht10
|
||||
} // namespace esphome
|
||||
} // namespace esphome::aht10
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace aic3204 {
|
||||
namespace esphome::aic3204 {
|
||||
|
||||
static const char *const TAG = "aic3204";
|
||||
|
||||
@@ -167,5 +166,4 @@ bool AIC3204::write_volume_() {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace aic3204
|
||||
} // namespace esphome
|
||||
} // namespace esphome::aic3204
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/hal.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace aic3204 {
|
||||
namespace esphome::aic3204 {
|
||||
|
||||
// TLV320AIC3204 Register Addresses
|
||||
// Page 0
|
||||
@@ -83,5 +82,4 @@ class AIC3204 : public audio_dac::AudioDac, public Component, public i2c::I2CDev
|
||||
float volume_{0};
|
||||
};
|
||||
|
||||
} // namespace aic3204
|
||||
} // namespace esphome
|
||||
} // namespace esphome::aic3204
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "aic3204.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace aic3204 {
|
||||
namespace esphome::aic3204 {
|
||||
|
||||
template<typename... Ts> class SetAutoMuteAction : public Action<Ts...> {
|
||||
public:
|
||||
@@ -19,5 +18,4 @@ template<typename... Ts> class SetAutoMuteAction : public Action<Ts...> {
|
||||
AIC3204 *aic3204_;
|
||||
};
|
||||
|
||||
} // namespace aic3204
|
||||
} // namespace esphome
|
||||
} // namespace esphome::aic3204
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_ble {
|
||||
namespace esphome::airthings_ble {
|
||||
|
||||
static const char *const TAG = "airthings_ble";
|
||||
|
||||
@@ -29,7 +28,6 @@ bool AirthingsListener::parse_device(const esp32_ble_tracker::ESPBTDevice &devic
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace airthings_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_ble
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,15 +5,13 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/components/esp32_ble_tracker/esp32_ble_tracker.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_ble {
|
||||
namespace esphome::airthings_ble {
|
||||
|
||||
class AirthingsListener : public esp32_ble_tracker::ESPBTDeviceListener {
|
||||
public:
|
||||
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override;
|
||||
};
|
||||
|
||||
} // namespace airthings_ble
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_ble
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_wave_base {
|
||||
namespace esphome::airthings_wave_base {
|
||||
|
||||
static const char *const TAG = "airthings_wave_base";
|
||||
|
||||
@@ -211,7 +210,6 @@ void AirthingsWaveBase::set_response_timeout_() {
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace airthings_wave_base
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_wave_base
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_wave_base {
|
||||
namespace esphome::airthings_wave_base {
|
||||
|
||||
namespace espbt = esphome::esp32_ble_tracker;
|
||||
|
||||
@@ -84,7 +83,6 @@ class AirthingsWaveBase : public PollingComponent, public ble_client::BLEClientN
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace airthings_wave_base
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_wave_base
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_wave_mini {
|
||||
namespace esphome::airthings_wave_mini {
|
||||
|
||||
static const char *const TAG = "airthings_wave_mini";
|
||||
|
||||
@@ -49,7 +48,6 @@ AirthingsWaveMini::AirthingsWaveMini() {
|
||||
espbt::ESPBTUUID::from_raw(ACCESS_CONTROL_POINT_CHARACTERISTIC_UUID);
|
||||
}
|
||||
|
||||
} // namespace airthings_wave_mini
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_wave_mini
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
#include "esphome/components/airthings_wave_base/airthings_wave_base.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_wave_mini {
|
||||
namespace esphome::airthings_wave_mini {
|
||||
|
||||
namespace espbt = esphome::esp32_ble_tracker;
|
||||
|
||||
@@ -34,7 +33,6 @@ class AirthingsWaveMini : public airthings_wave_base::AirthingsWaveBase {
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace airthings_wave_mini
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_wave_mini
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_wave_plus {
|
||||
namespace esphome::airthings_wave_plus {
|
||||
|
||||
static const char *const TAG = "airthings_wave_plus";
|
||||
|
||||
@@ -98,7 +97,6 @@ void AirthingsWavePlus::setup() {
|
||||
espbt::ESPBTUUID::from_raw(access_control_point_characteristic_uuid);
|
||||
}
|
||||
|
||||
} // namespace airthings_wave_plus
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_wave_plus
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
#include "esphome/components/airthings_wave_base/airthings_wave_base.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace airthings_wave_plus {
|
||||
namespace esphome::airthings_wave_plus {
|
||||
|
||||
namespace espbt = esphome::esp32_ble_tracker;
|
||||
|
||||
@@ -58,7 +57,6 @@ class AirthingsWavePlus : public airthings_wave_base::AirthingsWaveBase {
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace airthings_wave_plus
|
||||
} // namespace esphome
|
||||
} // namespace esphome::airthings_wave_plus
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace alpha3 {
|
||||
namespace esphome::alpha3 {
|
||||
|
||||
static const char *const TAG = "alpha3";
|
||||
|
||||
@@ -185,7 +184,6 @@ void Alpha3::update() {
|
||||
delay(25); // need to wait between requests
|
||||
}
|
||||
}
|
||||
} // namespace alpha3
|
||||
} // namespace esphome
|
||||
} // namespace esphome::alpha3
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
#include <esp_gattc_api.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace alpha3 {
|
||||
namespace esphome::alpha3 {
|
||||
|
||||
namespace espbt = esphome::esp32_ble_tracker;
|
||||
|
||||
@@ -64,7 +63,6 @@ class Alpha3 : public esphome::ble_client::BLEClientNode, public PollingComponen
|
||||
void send_request_(uint8_t *request, size_t len);
|
||||
bool is_current_response_type_(const uint8_t *response_type);
|
||||
};
|
||||
} // namespace alpha3
|
||||
} // namespace esphome
|
||||
} // namespace esphome::alpha3
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace am2315c {
|
||||
namespace esphome::am2315c {
|
||||
|
||||
static const char *const TAG = "am2315c";
|
||||
|
||||
@@ -176,5 +175,4 @@ void AM2315C::dump_config() {
|
||||
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
||||
}
|
||||
|
||||
} // namespace am2315c
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am2315c
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/core/component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace am2315c {
|
||||
namespace esphome::am2315c {
|
||||
|
||||
class AM2315C : public PollingComponent, public i2c::I2CDevice {
|
||||
public:
|
||||
@@ -45,5 +44,4 @@ class AM2315C : public PollingComponent, public i2c::I2CDevice {
|
||||
sensor::Sensor *humidity_sensor_{nullptr};
|
||||
};
|
||||
|
||||
} // namespace am2315c
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am2315c
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace am2320 {
|
||||
namespace esphome::am2320 {
|
||||
|
||||
static const char *const TAG = "am2320";
|
||||
|
||||
@@ -86,5 +85,4 @@ bool AM2320Component::read_data_(uint8_t *data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace am2320
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am2320
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace am2320 {
|
||||
namespace esphome::am2320 {
|
||||
|
||||
class AM2320Component : public PollingComponent, public i2c::I2CDevice {
|
||||
public:
|
||||
@@ -24,5 +23,4 @@ class AM2320Component : public PollingComponent, public i2c::I2CDevice {
|
||||
sensor::Sensor *humidity_sensor_{nullptr};
|
||||
};
|
||||
|
||||
} // namespace am2320
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am2320
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include <cstring>
|
||||
|
||||
namespace esphome {
|
||||
namespace am43 {
|
||||
namespace esphome::am43 {
|
||||
|
||||
const uint8_t START_PACKET[5] = {0x00, 0xff, 0x00, 0x00, 0x9a};
|
||||
|
||||
@@ -134,5 +133,4 @@ void Am43Decoder::decode(const uint8_t *data, uint16_t length) {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace am43
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am43
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace am43 {
|
||||
namespace esphome::am43 {
|
||||
|
||||
static const uint16_t AM43_SERVICE_UUID = 0xFE50;
|
||||
static const uint16_t AM43_CHARACTERISTIC_UUID = 0xFE51;
|
||||
@@ -74,5 +73,4 @@ class Am43Decoder {
|
||||
bool has_pin_response_;
|
||||
};
|
||||
|
||||
} // namespace am43
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am43
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace am43 {
|
||||
namespace esphome::am43 {
|
||||
|
||||
static const char *const TAG = "am43_cover";
|
||||
|
||||
@@ -154,7 +153,6 @@ void Am43Component::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace am43
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am43
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
|
||||
#include <esp_gattc_api.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace am43 {
|
||||
namespace esphome::am43 {
|
||||
|
||||
namespace espbt = esphome::esp32_ble_tracker;
|
||||
|
||||
@@ -38,7 +37,6 @@ class Am43Component : public cover::Cover, public esphome::ble_client::BLEClient
|
||||
float position_;
|
||||
};
|
||||
|
||||
} // namespace am43
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am43
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace am43 {
|
||||
namespace esphome::am43 {
|
||||
|
||||
static const char *const TAG = "am43";
|
||||
|
||||
@@ -111,7 +110,6 @@ void Am43::update() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace am43
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am43
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
|
||||
#include <esp_gattc_api.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace am43 {
|
||||
namespace esphome::am43 {
|
||||
|
||||
namespace espbt = esphome::esp32_ble_tracker;
|
||||
|
||||
@@ -38,7 +37,6 @@ class Am43 : public esphome::ble_client::BLEClientNode, public PollingComponent
|
||||
uint32_t last_battery_update_;
|
||||
};
|
||||
|
||||
} // namespace am43
|
||||
} // namespace esphome
|
||||
} // namespace esphome::am43
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "analog_threshold_binary_sensor.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace analog_threshold {
|
||||
namespace esphome::analog_threshold {
|
||||
|
||||
static const char *const TAG = "analog_threshold.binary_sensor";
|
||||
|
||||
@@ -43,5 +42,4 @@ void AnalogThresholdBinarySensor::dump_config() {
|
||||
this->upper_threshold_.value(), this->lower_threshold_.value());
|
||||
}
|
||||
|
||||
} // namespace analog_threshold
|
||||
} // namespace esphome
|
||||
} // namespace esphome::analog_threshold
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
#include "esphome/components/binary_sensor/binary_sensor.h"
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace analog_threshold {
|
||||
namespace esphome::analog_threshold {
|
||||
|
||||
class AnalogThresholdBinarySensor : public Component, public binary_sensor::BinarySensor {
|
||||
public:
|
||||
@@ -24,5 +23,4 @@ class AnalogThresholdBinarySensor : public Component, public binary_sensor::Bina
|
||||
bool raw_state_{false}; // Pre-filter state for hysteresis logic
|
||||
};
|
||||
|
||||
} // namespace analog_threshold
|
||||
} // namespace esphome
|
||||
} // namespace esphome::analog_threshold
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "esphome/core/hal.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace animation {
|
||||
namespace esphome::animation {
|
||||
|
||||
Animation::Animation(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count,
|
||||
image::ImageType type, image::Transparency transparent)
|
||||
@@ -71,5 +70,4 @@ void Animation::update_data_start_() {
|
||||
this->data_start_ = this->animation_data_start_ + image_size * this->current_frame_;
|
||||
}
|
||||
|
||||
} // namespace animation
|
||||
} // namespace esphome
|
||||
} // namespace esphome::animation
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include "esphome/core/automation.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace animation {
|
||||
namespace esphome::animation {
|
||||
|
||||
class Animation : public image::Image {
|
||||
public:
|
||||
@@ -64,5 +63,4 @@ template<typename... Ts> class AnimationSetFrameAction : public Action<Ts...> {
|
||||
Animation *parent_;
|
||||
};
|
||||
|
||||
} // namespace animation
|
||||
} // namespace esphome
|
||||
} // namespace esphome::animation
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace anova {
|
||||
namespace esphome::anova {
|
||||
|
||||
static const char *const TAG = "anova";
|
||||
|
||||
@@ -160,7 +159,6 @@ void Anova::update() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace anova
|
||||
} // namespace esphome
|
||||
} // namespace esphome::anova
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
|
||||
#include <esp_gattc_api.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace anova {
|
||||
namespace esphome::anova {
|
||||
|
||||
namespace espbt = esphome::esp32_ble_tracker;
|
||||
|
||||
@@ -45,7 +44,6 @@ class Anova : public climate::Climate, public esphome::ble_client::BLEClientNode
|
||||
bool fahrenheit_;
|
||||
};
|
||||
|
||||
} // namespace anova
|
||||
} // namespace esphome
|
||||
} // namespace esphome::anova
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
#include "esphome/core/alloc_helpers.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace anova {
|
||||
namespace esphome::anova {
|
||||
|
||||
float ftoc(float f) { return (f - 32.0) * (5.0f / 9.0f); }
|
||||
|
||||
@@ -132,5 +131,4 @@ void AnovaCodec::decode(const uint8_t *data, uint16_t length) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace anova
|
||||
} // namespace esphome
|
||||
} // namespace esphome::anova
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace anova {
|
||||
namespace esphome::anova {
|
||||
|
||||
enum CurrentQuery {
|
||||
NONE,
|
||||
@@ -75,5 +74,4 @@ class AnovaCodec {
|
||||
CurrentQuery current_query_;
|
||||
};
|
||||
|
||||
} // namespace anova
|
||||
} // namespace esphome
|
||||
} // namespace esphome::anova
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace apds9306 {
|
||||
namespace esphome::apds9306 {
|
||||
|
||||
static const char *const TAG = "apds9306";
|
||||
|
||||
@@ -147,5 +146,4 @@ void APDS9306::update() {
|
||||
this->publish_state(lux);
|
||||
}
|
||||
|
||||
} // namespace apds9306
|
||||
} // namespace esphome
|
||||
} // namespace esphome::apds9306
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/core/component.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace apds9306 {
|
||||
namespace esphome::apds9306 {
|
||||
|
||||
enum MeasurementBitWidth : uint8_t {
|
||||
MEASUREMENT_BIT_WIDTH_20 = 0,
|
||||
@@ -62,5 +61,4 @@ class APDS9306 : public sensor::Sensor, public PollingComponent, public i2c::I2C
|
||||
AmbientLightGain gain_;
|
||||
};
|
||||
|
||||
} // namespace apds9306
|
||||
} // namespace esphome
|
||||
} // namespace esphome::apds9306
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/hal.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace apds9960 {
|
||||
namespace esphome::apds9960 {
|
||||
|
||||
static const char *const TAG = "apds9960";
|
||||
|
||||
@@ -402,5 +401,4 @@ bool APDS9960::is_gesture_enabled_() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace apds9960
|
||||
} // namespace esphome
|
||||
} // namespace esphome::apds9960
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#include "esphome/components/binary_sensor/binary_sensor.h"
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace apds9960 {
|
||||
namespace esphome::apds9960 {
|
||||
|
||||
class APDS9960 : public PollingComponent, public i2c::I2CDevice {
|
||||
#ifdef USE_SENSOR
|
||||
@@ -71,5 +70,4 @@ class APDS9960 : public PollingComponent, public i2c::I2CDevice {
|
||||
uint32_t gesture_start_{0};
|
||||
};
|
||||
|
||||
} // namespace apds9960
|
||||
} // namespace esphome
|
||||
} // namespace esphome::apds9960
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "as3935.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as3935 {
|
||||
namespace esphome::as3935 {
|
||||
|
||||
static const char *const TAG = "as3935";
|
||||
|
||||
@@ -320,5 +319,4 @@ uint8_t AS3935Component::read_register_(uint8_t reg, uint8_t mask) {
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace as3935
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as3935
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#include "esphome/components/binary_sensor/binary_sensor.h"
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace as3935 {
|
||||
namespace esphome::as3935 {
|
||||
|
||||
static const uint8_t DIRECT_COMMAND = 0x96;
|
||||
static const uint8_t ANTFREQ = 3;
|
||||
@@ -127,5 +126,4 @@ class AS3935Component : public Component {
|
||||
bool calibration_;
|
||||
};
|
||||
|
||||
} // namespace as3935
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as3935
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "as3935_i2c.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as3935_i2c {
|
||||
namespace esphome::as3935_i2c {
|
||||
|
||||
static const char *const TAG = "as3935_i2c";
|
||||
|
||||
@@ -40,5 +39,4 @@ void I2CAS3935Component::dump_config() {
|
||||
LOG_I2C_DEVICE(this);
|
||||
}
|
||||
|
||||
} // namespace as3935_i2c
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as3935_i2c
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
#include "esphome/components/as3935/as3935.h"
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as3935_i2c {
|
||||
namespace esphome::as3935_i2c {
|
||||
|
||||
class I2CAS3935Component : public as3935::AS3935Component, public i2c::I2CDevice {
|
||||
public:
|
||||
@@ -15,5 +14,4 @@ class I2CAS3935Component : public as3935::AS3935Component, public i2c::I2CDevice
|
||||
uint8_t read_register(uint8_t reg) override;
|
||||
};
|
||||
|
||||
} // namespace as3935_i2c
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as3935_i2c
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "as3935_spi.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as3935_spi {
|
||||
namespace esphome::as3935_spi {
|
||||
|
||||
static const char *const TAG = "as3935_spi";
|
||||
|
||||
@@ -42,5 +41,4 @@ uint8_t SPIAS3935Component::read_register(uint8_t reg) {
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace as3935_spi
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as3935_spi
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/components/as3935/as3935.h"
|
||||
#include "esphome/components/spi/spi.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as3935_spi {
|
||||
namespace esphome::as3935_spi {
|
||||
|
||||
enum AS3935RegisterMasks { SPI_READ_M = 0x40 };
|
||||
|
||||
@@ -21,5 +20,4 @@ class SPIAS3935Component : public as3935::AS3935Component,
|
||||
uint8_t read_register(uint8_t reg) override;
|
||||
};
|
||||
|
||||
} // namespace as3935_spi
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as3935_spi
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "as5600.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as5600 {
|
||||
namespace esphome::as5600 {
|
||||
|
||||
static const char *const TAG = "as5600";
|
||||
|
||||
@@ -134,5 +133,4 @@ optional<uint16_t> AS5600Component::read_raw_position() {
|
||||
return pos;
|
||||
}
|
||||
|
||||
} // namespace as5600
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as5600
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as5600 {
|
||||
namespace esphome::as5600 {
|
||||
|
||||
static const uint16_t POSITION_COUNT = 4096;
|
||||
static const float RAW_TO_DEGREES = 360.0 / POSITION_COUNT;
|
||||
@@ -100,5 +99,4 @@ class AS5600Component : public Component, public i2c::I2CDevice {
|
||||
float range_scale_{1.0};
|
||||
};
|
||||
|
||||
} // namespace as5600
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as5600
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "as5600_sensor.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as5600 {
|
||||
namespace esphome::as5600 {
|
||||
|
||||
static const char *const TAG = "as5600.sensor";
|
||||
|
||||
@@ -75,5 +74,4 @@ void AS5600Sensor::update() {
|
||||
this->status_clear_warning();
|
||||
}
|
||||
|
||||
} // namespace as5600
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as5600
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/components/as5600/as5600.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as5600 {
|
||||
namespace esphome::as5600 {
|
||||
|
||||
class AS5600Sensor : public PollingComponent, public Parented<AS5600Component>, public sensor::Sensor {
|
||||
public:
|
||||
@@ -32,5 +31,4 @@ class AS5600Sensor : public PollingComponent, public Parented<AS5600Component>,
|
||||
OutRangeMode out_of_range_mode_{OUT_RANGE_MODE_MIN_MAX};
|
||||
};
|
||||
|
||||
} // namespace as5600
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as5600
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/hal.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as7341 {
|
||||
namespace esphome::as7341 {
|
||||
|
||||
static const char *const TAG = "as7341";
|
||||
|
||||
@@ -266,5 +265,4 @@ bool AS7341Component::clear_register_bit(uint8_t address, uint8_t bit_position)
|
||||
|
||||
uint16_t AS7341Component::swap_bytes(uint16_t data) { return (data >> 8) | (data << 8); }
|
||||
|
||||
} // namespace as7341
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as7341
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace as7341 {
|
||||
namespace esphome::as7341 {
|
||||
|
||||
static const uint8_t AS7341_CHIP_ID = 0x09;
|
||||
|
||||
@@ -139,5 +138,4 @@ class AS7341Component : public PollingComponent, public i2c::I2CDevice {
|
||||
uint16_t channel_readings_[12];
|
||||
};
|
||||
|
||||
} // namespace as7341
|
||||
} // namespace esphome
|
||||
} // namespace esphome::as7341
|
||||
|
||||
@@ -49,8 +49,7 @@ const uint8_t TRIGGER_KEEP_TIME_ADDR = 0x42; // 4 bytes, so up to 0x45
|
||||
const uint8_t TIME41_VALUE = 1;
|
||||
const uint8_t SELF_CHECK_TIME_ADDR = 0x38; // 2 bytes, up to 0x39
|
||||
|
||||
namespace esphome {
|
||||
namespace at581x {
|
||||
namespace esphome::at581x {
|
||||
|
||||
static const char *const TAG = "at581x";
|
||||
|
||||
@@ -199,5 +198,4 @@ void AT581XComponent::set_rf_mode(bool enable) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace at581x
|
||||
} // namespace esphome
|
||||
} // namespace esphome::at581x
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#endif
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace at581x {
|
||||
namespace esphome::at581x {
|
||||
|
||||
class AT581XComponent : public Component, public i2c::I2CDevice {
|
||||
public:
|
||||
@@ -58,5 +57,4 @@ class AT581XComponent : public Component, public i2c::I2CDevice {
|
||||
int power_; /*!< In µA */
|
||||
};
|
||||
|
||||
} // namespace at581x
|
||||
} // namespace esphome
|
||||
} // namespace esphome::at581x
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include "at581x.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace at581x {
|
||||
namespace esphome::at581x {
|
||||
|
||||
template<typename... Ts> class AT581XResetAction : public Action<Ts...>, public Parented<AT581XComponent> {
|
||||
public:
|
||||
@@ -67,5 +66,4 @@ template<typename... Ts> class AT581XSettingsAction : public Action<Ts...>, publ
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace at581x
|
||||
} // namespace esphome
|
||||
} // namespace esphome::at581x
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#include "rf_switch.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace at581x {
|
||||
namespace esphome::at581x {
|
||||
|
||||
void RFSwitch::write_state(bool state) {
|
||||
this->publish_state(state);
|
||||
this->parent_->set_rf_mode(state);
|
||||
}
|
||||
|
||||
} // namespace at581x
|
||||
} // namespace esphome
|
||||
} // namespace esphome::at581x
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
#include "esphome/components/switch/switch.h"
|
||||
#include "../at581x.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace at581x {
|
||||
namespace esphome::at581x {
|
||||
|
||||
class RFSwitch : public switch_::Switch, public Parented<AT581XComponent> {
|
||||
protected:
|
||||
void write_state(bool state) override;
|
||||
};
|
||||
|
||||
} // namespace at581x
|
||||
} // namespace esphome
|
||||
} // namespace esphome::at581x
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace atc_mithermometer {
|
||||
namespace esphome::atc_mithermometer {
|
||||
|
||||
static const char *const TAG = "atc_mithermometer";
|
||||
|
||||
@@ -133,7 +132,6 @@ bool ATCMiThermometer::report_results_(const optional<ParseResult> &result, cons
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace atc_mithermometer
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atc_mithermometer
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
namespace esphome {
|
||||
namespace atc_mithermometer {
|
||||
namespace esphome::atc_mithermometer {
|
||||
|
||||
struct ParseResult {
|
||||
optional<float> temperature;
|
||||
@@ -44,7 +43,6 @@ class ATCMiThermometer : public Component, public esp32_ble_tracker::ESPBTDevice
|
||||
bool report_results_(const optional<ParseResult> &result, const char *address);
|
||||
};
|
||||
|
||||
} // namespace atc_mithermometer
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atc_mithermometer
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "atm90e26_reg.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace atm90e26 {
|
||||
namespace esphome::atm90e26 {
|
||||
|
||||
static const char *const TAG = "atm90e26";
|
||||
|
||||
@@ -229,5 +228,4 @@ float ATM90E26Component::get_frequency_() {
|
||||
return freq / 100.0f;
|
||||
}
|
||||
|
||||
} // namespace atm90e26
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atm90e26
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/components/sensor/sensor.h"
|
||||
#include "esphome/components/spi/spi.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace atm90e26 {
|
||||
namespace esphome::atm90e26 {
|
||||
|
||||
class ATM90E26Component : public PollingComponent,
|
||||
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH,
|
||||
@@ -67,5 +66,4 @@ class ATM90E26Component : public PollingComponent,
|
||||
uint32_t pl_const_{1429876};
|
||||
};
|
||||
|
||||
} // namespace atm90e26
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atm90e26
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace esphome {
|
||||
namespace atm90e26 {
|
||||
namespace esphome::atm90e26 {
|
||||
|
||||
/* Status and Special Register */
|
||||
static const uint8_t ATM90E26_REGISTER_SOFTRESET = 0x00; // Software Reset
|
||||
@@ -66,5 +65,4 @@ static const uint8_t ATM90E26_REGISTER_POWERF2 = 0x6D; // N Line Power Factor
|
||||
static const uint8_t ATM90E26_REGISTER_PANGLE2 = 0x6E; // Phase Angle between Voltage and N Line Current
|
||||
static const uint8_t ATM90E26_REGISTER_SMEAN2 = 0x6F; // N Line Mean Apparent Power
|
||||
|
||||
} // namespace atm90e26
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atm90e26
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
#include <numbers>
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace atm90e32 {
|
||||
namespace esphome::atm90e32 {
|
||||
|
||||
static const char *const TAG = "atm90e32";
|
||||
|
||||
@@ -1313,5 +1312,4 @@ bool ATM90E32Component::validate_spi_read_(uint16_t expected, const char *contex
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace atm90e32
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atm90e32
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/preferences.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace atm90e32 {
|
||||
namespace esphome::atm90e32 {
|
||||
|
||||
class ATM90E32Component : public PollingComponent,
|
||||
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH,
|
||||
@@ -275,5 +274,4 @@ class ATM90E32Component : public PollingComponent,
|
||||
bool gain_calibration_mismatch_[3]{false, false, false};
|
||||
};
|
||||
|
||||
} // namespace atm90e32
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atm90e32
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
namespace atm90e32 {
|
||||
namespace esphome::atm90e32 {
|
||||
|
||||
/* STATUS REGISTERS */
|
||||
static const uint16_t ATM90E32_REGISTER_METEREN = 0x00; // Metering Enable
|
||||
@@ -268,5 +267,4 @@ static const uint16_t ATM90E32_REGISTER_UANGLEA = 0xFD; // A Voltage Phase Angl
|
||||
static const uint16_t ATM90E32_REGISTER_UANGLEB = 0xFE; // B Voltage Phase Angle
|
||||
static const uint16_t ATM90E32_REGISTER_UANGLEC = 0xFF; // C Voltage Phase Angle
|
||||
|
||||
} // namespace atm90e32
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atm90e32
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace atm90e32 {
|
||||
namespace esphome::atm90e32 {
|
||||
|
||||
static const char *const TAG = "atm90e32.button";
|
||||
|
||||
@@ -75,5 +74,4 @@ void ATM90E32ClearPowerOffsetCalibrationButton::press_action() {
|
||||
this->parent_->clear_power_offset_calibrations();
|
||||
}
|
||||
|
||||
} // namespace atm90e32
|
||||
} // namespace esphome
|
||||
} // namespace esphome::atm90e32
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user