mirror of
https://github.com/esphome/esphome.git
synced 2026-09-04 03:56:04 +00:00
[clang-tidy] Concatenate nested namespaces (4/7: components n-r) (#16301)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
namespace nau7802 {
|
||||
namespace esphome::nau7802 {
|
||||
|
||||
enum NAU7802Gain {
|
||||
NAU7802_GAIN_128 = 0b111,
|
||||
@@ -114,5 +113,4 @@ template<typename... Ts> class NAU7802CalbrateGainAction : public Action<Ts...>,
|
||||
void play(const Ts &...x) override { this->parent_->calibrate_gain(); }
|
||||
};
|
||||
|
||||
} // namespace nau7802
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nau7802
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
#include "automation.h"
|
||||
#include "nfc.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace nfc {
|
||||
namespace esphome::nfc {
|
||||
|
||||
void NfcOnTagTrigger::process(const std::unique_ptr<NfcTag> &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
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
|
||||
#include "nfc.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace nfc {
|
||||
namespace esphome::nfc {
|
||||
|
||||
class NfcOnTagTrigger : public Trigger<std::string, NfcTag> {
|
||||
public:
|
||||
void process(const std::unique_ptr<NfcTag> &tag);
|
||||
};
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace esphome {
|
||||
namespace nfc {
|
||||
namespace esphome::nfc {
|
||||
|
||||
static const char *const TAG = "NciMessage";
|
||||
|
||||
@@ -162,5 +161,4 @@ void NciMessage::set_payload(const std::vector<uint8_t> &payload) {
|
||||
this->nci_message_ = message;
|
||||
}
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace nfc {
|
||||
namespace esphome::nfc {
|
||||
|
||||
class NciMessage {
|
||||
public:
|
||||
@@ -46,5 +45,4 @@ class NciMessage {
|
||||
std::vector<uint8_t> nci_message_{0, 0, 0}; // three bytes, MT/PBF/GID, OID, payload length/size
|
||||
};
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "ndef_message.h"
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome {
|
||||
namespace nfc {
|
||||
namespace esphome::nfc {
|
||||
|
||||
static const char *const TAG = "nfc.ndef_message";
|
||||
|
||||
@@ -120,5 +119,4 @@ std::vector<uint8_t> NdefMessage::encode() {
|
||||
return data;
|
||||
}
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -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<std::shared_ptr<NdefRecord>> records_;
|
||||
};
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
||||
@@ -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<uint8_t> NdefRecordText::get_encoded_payload() {
|
||||
return data;
|
||||
}
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
||||
@@ -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<uint8_t> NdefRecordUri::get_encoded_payload() {
|
||||
return data;
|
||||
}
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
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<NfcTagListener *> tag_listeners_;
|
||||
};
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<NdefMessage> ndef_message_;
|
||||
};
|
||||
|
||||
} // namespace nfc
|
||||
} // namespace esphome
|
||||
} // namespace esphome::nfc
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "hub.h"
|
||||
#include "opentherm.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace opentherm {
|
||||
namespace esphome::opentherm {
|
||||
|
||||
class BeforeSendTrigger : public Trigger<OpenthermData &> {
|
||||
public:
|
||||
@@ -21,5 +20,4 @@ class BeforeProcessResponseTrigger : public Trigger<OpenthermData &> {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace opentherm
|
||||
} // namespace esphome
|
||||
} // namespace esphome::opentherm
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
#endif
|
||||
#include <string>
|
||||
|
||||
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
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
#include "driver/gptimer.h"
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace opentherm {
|
||||
namespace esphome::opentherm {
|
||||
|
||||
template<class T> 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<typename... Ts> class TurnOffAction : public Action<Ts...> {
|
||||
public:
|
||||
@@ -67,5 +66,4 @@ template<typename... Ts> class SetMaxPowerAction : public Action<Ts...> {
|
||||
};
|
||||
#endif // USE_OUTPUT_FLOAT_POWER_SCALING
|
||||
|
||||
} // namespace output
|
||||
} // namespace esphome
|
||||
} // namespace esphome::output
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<typename T> using string_map_t = std::map<std::string, T, std::less<>>;
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<AddressableSegment> segments_;
|
||||
};
|
||||
|
||||
} // namespace partition
|
||||
} // namespace esphome
|
||||
} // namespace esphome::partition
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING,
|
||||
@@ -74,5 +73,4 @@ class PCD8544 : public display::DisplayBuffer,
|
||||
GPIOPin *dc_pin_;
|
||||
};
|
||||
|
||||
} // namespace pcd8544
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pcd8544
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
// Datasheet:
|
||||
// - https://datasheets.maximintegrated.com/en/ds/DS1307.pdf
|
||||
|
||||
namespace esphome {
|
||||
namespace pcf85063 {
|
||||
namespace esphome::pcf85063 {
|
||||
|
||||
static const char *const TAG = "pcf85063";
|
||||
|
||||
@@ -99,5 +98,4 @@ bool PCF85063Component::write_rtc_() {
|
||||
pcf85063_.reg.day_10, pcf85063_.reg.day, ONOFF(!pcf85063_.reg.osc_stop), pcf85063_.reg.clkout_control);
|
||||
return true;
|
||||
}
|
||||
} // namespace pcf85063
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pcf85063
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
#include "esphome/components/time/real_time_clock.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace pcf85063 {
|
||||
namespace esphome::pcf85063 {
|
||||
|
||||
class PCF85063Component : public time::RealTimeClock, public i2c::I2CDevice {
|
||||
public:
|
||||
@@ -91,5 +90,4 @@ template<typename... Ts> class ReadAction : public Action<Ts...>, public Parente
|
||||
public:
|
||||
void play(const Ts &...x) override { this->parent_->read_time(); }
|
||||
};
|
||||
} // namespace pcf85063
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pcf85063
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<typename... Ts> class ReadAction : public Action<Ts...>, public Parente
|
||||
public:
|
||||
void play(const Ts &...x) override { this->parent_->read_time(); }
|
||||
};
|
||||
} // namespace pcf8563
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pcf8563
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<uint8_t, 8> {
|
||||
@@ -70,5 +69,4 @@ class PI4IOE5V6408GPIOPin : public GPIOPin, public Parented<PI4IOE5V6408Componen
|
||||
gpio::Flags flags_;
|
||||
};
|
||||
|
||||
} // namespace pi4ioe5v6408
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pi4ioe5v6408
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
#define M_PI 3.1415926535897932384626433
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace pid {
|
||||
namespace esphome::pid {
|
||||
|
||||
static const char *const TAG = "pid.autotune";
|
||||
|
||||
@@ -368,5 +367,4 @@ bool PIDAutotuner::OscillationAmplitudeDetector::is_amplitude_convergent() const
|
||||
return (mean_amplitude - global_amplitude) / (global_amplitude) < 0.05f;
|
||||
}
|
||||
|
||||
} // namespace pid
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pid
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
||||
@@ -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<PIDAutotuner> &&autotune) {
|
||||
|
||||
void PIDClimate::reset_integral_term() { this->controller_.reset_accumulated_integral(); }
|
||||
|
||||
} // namespace pid
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pid
|
||||
|
||||
@@ -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<typename... Ts> class PIDSetControlParametersAction : public Action<Ts.
|
||||
PIDClimate *parent_;
|
||||
};
|
||||
|
||||
} // namespace pid
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pid
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "pid_controller.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace pid {
|
||||
namespace esphome::pid {
|
||||
|
||||
float PIDController::update(float setpoint, float process_value) {
|
||||
// e(t) ... error at timestamp t
|
||||
@@ -123,5 +122,4 @@ float PIDController::calculate_relative_time_() {
|
||||
return dt / 1000.0f;
|
||||
}
|
||||
|
||||
} // namespace pid
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pid
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include <cmath>
|
||||
|
||||
namespace esphome {
|
||||
namespace pid {
|
||||
namespace esphome::pid {
|
||||
|
||||
struct PIDController {
|
||||
float update(float setpoint, float process_value);
|
||||
@@ -71,5 +70,4 @@ struct PIDController {
|
||||
FixedRingBuffer<float> output_window_;
|
||||
|
||||
}; // Struct PIDController
|
||||
} // namespace pid
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pid
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace esphome {
|
||||
namespace pipsolar {
|
||||
namespace esphome::pipsolar {
|
||||
|
||||
class Pipsolar;
|
||||
|
||||
@@ -40,5 +39,4 @@ template<typename... Ts> class SetOutputAction : public Action<Ts...> {
|
||||
PipsolarOutput *output_;
|
||||
};
|
||||
|
||||
} // namespace pipsolar
|
||||
} // namespace esphome
|
||||
} // namespace esphome::pipsolar
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include <cstring>
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user