Merge branch 'dev' into mirage-implementation

This commit is contained in:
Jesse Hills 2024-04-15 09:02:25 +12:00 committed by GitHub
commit 0094165256
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 461 additions and 87 deletions

View File

@ -785,6 +785,7 @@ def parse_args(argv):
parser_logs = subparsers.add_parser(
"logs",
help="Validate the configuration and show all logs.",
aliases=["log"],
parents=[mqtt_options],
)
parser_logs.add_argument(

View File

@ -4,13 +4,14 @@ from esphome.components import i2c
from esphome.const import CONF_ID
DEPENDENCIES = ["i2c"]
AUTO_LOAD = ["sensor", "voltage_sampler"]
MULTI_CONF = True
ads1115_ns = cg.esphome_ns.namespace("ads1115")
ADS1115Component = ads1115_ns.class_("ADS1115Component", cg.Component, i2c.I2CDevice)
CONF_CONTINUOUS_MODE = "continuous_mode"
CONF_ADS1115_ID = "ads1115_id"
CONFIG_SCHEMA = (
cv.Schema(
{

View File

@ -1,6 +1,6 @@
#include "ads1115.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
#include "esphome/core/log.h"
namespace esphome {
namespace ads1115 {
@ -75,25 +75,19 @@ void ADS1115Component::dump_config() {
if (this->is_failed()) {
ESP_LOGE(TAG, "Communication with ADS1115 failed!");
}
for (auto *sensor : this->sensors_) {
LOG_SENSOR(" ", "Sensor", sensor);
ESP_LOGCONFIG(TAG, " Multiplexer: %u", sensor->get_multiplexer());
ESP_LOGCONFIG(TAG, " Gain: %u", sensor->get_gain());
ESP_LOGCONFIG(TAG, " Resolution: %u", sensor->get_resolution());
}
}
float ADS1115Component::request_measurement(ADS1115Sensor *sensor) {
float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain,
ADS1115Resolution resolution) {
uint16_t config = this->prev_config_;
// Multiplexer
// 0bxBBBxxxxxxxxxxxx
config &= 0b1000111111111111;
config |= (sensor->get_multiplexer() & 0b111) << 12;
config |= (multiplexer & 0b111) << 12;
// Gain
// 0bxxxxBBBxxxxxxxxx
config &= 0b1111000111111111;
config |= (sensor->get_gain() & 0b111) << 9;
config |= (gain & 0b111) << 9;
if (!this->continuous_mode_) {
// Start conversion
@ -132,7 +126,7 @@ float ADS1115Component::request_measurement(ADS1115Sensor *sensor) {
return NAN;
}
if (sensor->get_resolution() == ADS1015_12_BITS) {
if (resolution == ADS1015_12_BITS) {
bool negative = (raw_conversion >> 15) == 1;
// shift raw_conversion as it's only 12-bits, left justified
@ -151,8 +145,8 @@ float ADS1115Component::request_measurement(ADS1115Sensor *sensor) {
auto signed_conversion = static_cast<int16_t>(raw_conversion);
float millivolts;
float divider = (sensor->get_resolution() == ADS1115_16_BITS) ? 32768.0f : 2048.0f;
switch (sensor->get_gain()) {
float divider = (resolution == ADS1115_16_BITS) ? 32768.0f : 2048.0f;
switch (gain) {
case ADS1115_GAIN_6P144:
millivolts = (signed_conversion * 6144) / divider;
break;
@ -179,14 +173,5 @@ float ADS1115Component::request_measurement(ADS1115Sensor *sensor) {
return millivolts / 1e3f;
}
float ADS1115Sensor::sample() { return this->parent_->request_measurement(this); }
void ADS1115Sensor::update() {
float v = this->parent_->request_measurement(this);
if (!std::isnan(v)) {
ESP_LOGD(TAG, "'%s': Got Voltage=%fV", this->get_name().c_str(), v);
this->publish_state(v);
}
}
} // namespace ads1115
} // namespace esphome

View File

@ -1,9 +1,7 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/i2c/i2c.h"
#include "esphome/components/voltage_sampler/voltage_sampler.h"
#include "esphome/core/component.h"
#include <vector>
@ -35,12 +33,8 @@ enum ADS1115Resolution {
ADS1015_12_BITS = 12,
};
class ADS1115Sensor;
class ADS1115Component : public Component, public i2c::I2CDevice {
public:
void register_sensor(ADS1115Sensor *obj) { this->sensors_.push_back(obj); }
/// Set up the internal sensor array.
void setup() override;
void dump_config() override;
/// HARDWARE_LATE setup priority
@ -48,33 +42,12 @@ class ADS1115Component : public Component, public i2c::I2CDevice {
void set_continuous_mode(bool continuous_mode) { continuous_mode_ = continuous_mode; }
/// Helper method to request a measurement from a sensor.
float request_measurement(ADS1115Sensor *sensor);
float request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain, ADS1115Resolution resolution);
protected:
std::vector<ADS1115Sensor *> sensors_;
uint16_t prev_config_{0};
bool continuous_mode_;
};
/// Internal holder class that is in instance of Sensor so that the hub can create individual sensors.
class ADS1115Sensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
public:
ADS1115Sensor(ADS1115Component *parent) : parent_(parent) {}
void update() override;
void set_multiplexer(ADS1115Multiplexer multiplexer) { multiplexer_ = multiplexer; }
void set_gain(ADS1115Gain gain) { gain_ = gain; }
void set_resolution(ADS1115Resolution resolution) { resolution_ = resolution; }
float sample() override;
uint8_t get_multiplexer() const { return multiplexer_; }
uint8_t get_gain() const { return gain_; }
uint8_t get_resolution() const { return resolution_; }
protected:
ADS1115Component *parent_;
ADS1115Multiplexer multiplexer_;
ADS1115Gain gain_;
ADS1115Resolution resolution_;
};
} // namespace ads1115
} // namespace esphome

View File

@ -10,8 +10,9 @@ from esphome.const import (
UNIT_VOLT,
CONF_ID,
)
from . import ads1115_ns, ADS1115Component
from .. import ads1115_ns, ADS1115Component, CONF_ADS1115_ID
AUTO_LOAD = ["voltage_sampler"]
DEPENDENCIES = ["ads1115"]
ADS1115Multiplexer = ads1115_ns.enum("ADS1115Multiplexer")
@ -43,20 +44,10 @@ RESOLUTION = {
}
def validate_gain(value):
if isinstance(value, float):
value = f"{value:0.03f}"
elif not isinstance(value, str):
raise cv.Invalid(f'invalid gain "{value}"')
return cv.enum(GAIN)(value)
ADS1115Sensor = ads1115_ns.class_(
"ADS1115Sensor", sensor.Sensor, cg.PollingComponent, voltage_sampler.VoltageSampler
)
CONF_ADS1115_ID = "ads1115_id"
CONFIG_SCHEMA = (
sensor.sensor_schema(
ADS1115Sensor,
@ -69,7 +60,7 @@ CONFIG_SCHEMA = (
{
cv.GenerateID(CONF_ADS1115_ID): cv.use_id(ADS1115Component),
cv.Required(CONF_MULTIPLEXER): cv.enum(MUX, upper=True, space="_"),
cv.Required(CONF_GAIN): validate_gain,
cv.Required(CONF_GAIN): cv.enum(GAIN, string=True),
cv.Optional(CONF_RESOLUTION, default="16_BITS"): cv.enum(
RESOLUTION, upper=True, space="_"
),
@ -80,13 +71,11 @@ CONFIG_SCHEMA = (
async def to_code(config):
paren = await cg.get_variable(config[CONF_ADS1115_ID])
var = cg.new_Pvariable(config[CONF_ID], paren)
var = cg.new_Pvariable(config[CONF_ID])
await sensor.register_sensor(var, config)
await cg.register_component(var, config)
await cg.register_parented(var, config[CONF_ADS1115_ID])
cg.add(var.set_multiplexer(config[CONF_MULTIPLEXER]))
cg.add(var.set_gain(config[CONF_GAIN]))
cg.add(var.set_resolution(config[CONF_RESOLUTION]))
cg.add(paren.register_sensor(var))

View File

@ -0,0 +1,30 @@
#include "ads1115_sensor.h"
#include "esphome/core/log.h"
namespace esphome {
namespace ads1115 {
static const char *const TAG = "ads1115.sensor";
float ADS1115Sensor::sample() {
return this->parent_->request_measurement(this->multiplexer_, this->gain_, this->resolution_);
}
void ADS1115Sensor::update() {
float v = this->sample();
if (!std::isnan(v)) {
ESP_LOGD(TAG, "'%s': Got Voltage=%fV", this->get_name().c_str(), v);
this->publish_state(v);
}
}
void ADS1115Sensor::dump_config() {
LOG_SENSOR(" ", "ADS1115 Sensor", this);
ESP_LOGCONFIG(TAG, " Multiplexer: %u", this->multiplexer_);
ESP_LOGCONFIG(TAG, " Gain: %u", this->gain_);
ESP_LOGCONFIG(TAG, " Resolution: %u", this->resolution_);
}
} // namespace ads1115
} // namespace esphome

View File

@ -0,0 +1,35 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/helpers.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/voltage_sampler/voltage_sampler.h"
#include "../ads1115.h"
namespace esphome {
namespace ads1115 {
/// Internal holder class that is in instance of Sensor so that the hub can create individual sensors.
class ADS1115Sensor : public sensor::Sensor,
public PollingComponent,
public voltage_sampler::VoltageSampler,
public Parented<ADS1115Component> {
public:
void update() override;
void set_multiplexer(ADS1115Multiplexer multiplexer) { this->multiplexer_ = multiplexer; }
void set_gain(ADS1115Gain gain) { this->gain_ = gain; }
void set_resolution(ADS1115Resolution resolution) { this->resolution_ = resolution; }
float sample() override;
void dump_config() override;
protected:
ADS1115Multiplexer multiplexer_;
ADS1115Gain gain_;
ADS1115Resolution resolution_;
};
} // namespace ads1115
} // namespace esphome

View File

@ -340,6 +340,11 @@ network::IPAddresses EthernetComponent::get_ip_addresses() {
return addresses;
}
network::IPAddress EthernetComponent::get_dns_address(uint8_t num) {
const ip_addr_t *dns_ip = dns_getserver(num);
return dns_ip;
}
void EthernetComponent::eth_event_handler(void *arg, esp_event_base_t event_base, int32_t event, void *event_data) {
const char *event_name;

View File

@ -70,6 +70,7 @@ class EthernetComponent : public Component {
void set_manual_ip(const ManualIP &manual_ip);
network::IPAddresses get_ip_addresses();
network::IPAddress get_dns_address(uint8_t num);
std::string get_use_address() const;
void set_use_address(const std::string &use_address);
bool powerdown();

View File

@ -9,6 +9,7 @@ namespace ethernet_info {
static const char *const TAG = "ethernet_info";
void IPAddressEthernetInfo::dump_config() { LOG_TEXT_SENSOR("", "EthernetInfo IPAddress", this); }
void DNSAddressEthernetInfo::dump_config() { LOG_TEXT_SENSOR("", "EthernetInfo DNS Address", this); }
} // namespace ethernet_info
} // namespace esphome

View File

@ -38,6 +38,27 @@ class IPAddressEthernetInfo : public PollingComponent, public text_sensor::TextS
std::array<text_sensor::TextSensor *, 5> ip_sensors_;
};
class DNSAddressEthernetInfo : public PollingComponent, public text_sensor::TextSensor {
public:
void update() override {
auto dns_one = ethernet::global_eth_component->get_dns_address(0);
auto dns_two = ethernet::global_eth_component->get_dns_address(1);
std::string dns_results = dns_one.str() + " " + dns_two.str();
if (dns_results != this->last_results_) {
this->last_results_ = dns_results;
this->publish_state(dns_results);
}
}
float get_setup_priority() const override { return setup_priority::ETHERNET; }
std::string unique_id() override { return get_mac_address() + "-ethernetinfo-dns"; }
void dump_config() override;
protected:
std::string last_results_;
};
} // namespace ethernet_info
} // namespace esphome

View File

@ -3,6 +3,7 @@ import esphome.config_validation as cv
from esphome.components import text_sensor
from esphome.const import (
CONF_IP_ADDRESS,
CONF_DNS_ADDRESS,
ENTITY_CATEGORY_DIAGNOSTIC,
)
@ -10,14 +11,18 @@ DEPENDENCIES = ["ethernet"]
ethernet_info_ns = cg.esphome_ns.namespace("ethernet_info")
IPAddressEsthernetInfo = ethernet_info_ns.class_(
IPAddressEthernetInfo = ethernet_info_ns.class_(
"IPAddressEthernetInfo", text_sensor.TextSensor, cg.PollingComponent
)
DNSAddressEthernetInfo = ethernet_info_ns.class_(
"DNSAddressEthernetInfo", text_sensor.TextSensor, cg.PollingComponent
)
CONFIG_SCHEMA = cv.Schema(
{
cv.Optional(CONF_IP_ADDRESS): text_sensor.text_sensor_schema(
IPAddressEsthernetInfo, entity_category=ENTITY_CATEGORY_DIAGNOSTIC
IPAddressEthernetInfo, entity_category=ENTITY_CATEGORY_DIAGNOSTIC
)
.extend(cv.polling_component_schema("1s"))
.extend(
@ -27,7 +32,10 @@ CONFIG_SCHEMA = cv.Schema(
)
for x in range(5)
}
)
),
cv.Optional(CONF_DNS_ADDRESS): text_sensor.text_sensor_schema(
DNSAddressEthernetInfo, entity_category=ENTITY_CATEGORY_DIAGNOSTIC
).extend(cv.polling_component_schema("1s")),
}
)
@ -40,3 +48,6 @@ async def to_code(config):
if sensor_conf := conf.get(f"address_{x}"):
sens = await text_sensor.new_text_sensor(sensor_conf)
cg.add(ip_info.add_ip_sensors(x, sens))
if conf := config.get(CONF_DNS_ADDRESS):
dns_info = await text_sensor.new_text_sensor(config[CONF_DNS_ADDRESS])
await cg.register_component(dns_info, config[CONF_DNS_ADDRESS])

View File

@ -76,12 +76,27 @@ void HTU21DComponent::update() {
float humidity = (float(raw_humidity & 0xFFFC)) * 125.0f / 65536.0f - 6.0f;
int8_t heater_level = this->get_heater_level();
ESP_LOGD(TAG, "Got Humidity=%.1f%% Heater Level=%d", humidity, heater_level);
ESP_LOGD(TAG, "Got Humidity=%.1f%%", humidity);
if (this->humidity_ != nullptr)
this->humidity_->publish_state(humidity);
int8_t heater_level;
// HTU21D does have a heater module but does not have heater level
// Setting heater level to 1 in case the heater is ON
if (this->sensor_model_ == HTU21D_SENSOR_MODEL_HTU21D) {
if (this->is_heater_enabled()) {
heater_level = 1;
} else {
heater_level = 0;
}
} else {
heater_level = this->get_heater_level();
}
ESP_LOGD(TAG, "Heater Level=%d", heater_level);
if (this->heater_ != nullptr)
this->heater_->publish_state(heater_level);
this->status_clear_warning();

View File

@ -8,6 +8,8 @@
namespace esphome {
namespace htu21d {
enum HTU21DSensorModels { HTU21D_SENSOR_MODEL_HTU21D = 0, HTU21D_SENSOR_MODEL_SI7021, HTU21D_SENSOR_MODEL_SHT21 };
class HTU21DComponent : public PollingComponent, public i2c::I2CDevice {
public:
void set_temperature(sensor::Sensor *temperature) { temperature_ = temperature; }
@ -17,6 +19,7 @@ class HTU21DComponent : public PollingComponent, public i2c::I2CDevice {
/// Setup (reset) the sensor and check connection.
void setup() override;
void dump_config() override;
void set_sensor_model(HTU21DSensorModels sensor_model) { sensor_model_ = sensor_model; }
/// Update the sensor values (temperature+humidity).
void update() override;
@ -31,6 +34,7 @@ class HTU21DComponent : public PollingComponent, public i2c::I2CDevice {
sensor::Sensor *temperature_{nullptr};
sensor::Sensor *humidity_{nullptr};
sensor::Sensor *heater_{nullptr};
HTU21DSensorModels sensor_model_{HTU21D_SENSOR_MODEL_HTU21D};
};
template<typename... Ts> class SetHeaterLevelAction : public Action<Ts...>, public Parented<HTU21DComponent> {

View File

@ -5,6 +5,7 @@ from esphome import automation
from esphome.const import (
CONF_HUMIDITY,
CONF_ID,
CONF_MODEL,
CONF_TEMPERATURE,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
@ -23,10 +24,15 @@ htu21d_ns = cg.esphome_ns.namespace("htu21d")
HTU21DComponent = htu21d_ns.class_(
"HTU21DComponent", cg.PollingComponent, i2c.I2CDevice
)
SetHeaterLevelAction = htu21d_ns.class_("SetHeaterLevelAction", automation.Action)
SetHeaterAction = htu21d_ns.class_("SetHeaterAction", automation.Action)
HTU21DSensorModels = htu21d_ns.enum("HTU21DSensorModels")
MODELS = {
"HTU21D": HTU21DSensorModels.HTU21D_SENSOR_MODEL_HTU21D,
"SI7021": HTU21DSensorModels.HTU21D_SENSOR_MODEL_SI7021,
"SHT21": HTU21DSensorModels.HTU21D_SENSOR_MODEL_SHT21,
}
CONFIG_SCHEMA = (
cv.Schema(
@ -49,6 +55,7 @@ CONFIG_SCHEMA = (
accuracy_decimals=1,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_MODEL, default="HTU21D"): cv.enum(MODELS, upper=True),
}
)
.extend(cv.polling_component_schema("60s"))
@ -73,6 +80,8 @@ async def to_code(config):
sens = await sensor.new_sensor(config[CONF_HEATER])
cg.add(var.set_heater(sens))
cg.add(var.set_sensor_model(config[CONF_MODEL]))
@automation.register_action(
"htu21d.set_heater_level",

View File

@ -729,6 +729,7 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
}
void VoiceAssistant::on_audio(const api::VoiceAssistantAudio &msg) {
#ifdef USE_SPEAKER // We should never get to this function if there is no speaker anyway
if (this->speaker_buffer_index_ + msg.data.length() < SPEAKER_BUFFER_SIZE) {
memcpy(this->speaker_buffer_ + this->speaker_buffer_index_, msg.data.data(), msg.data.length());
this->speaker_buffer_index_ += msg.data.length();
@ -737,6 +738,7 @@ void VoiceAssistant::on_audio(const api::VoiceAssistantAudio &msg) {
} else {
ESP_LOGE(TAG, "Cannot receive audio, buffer is full");
}
#endif
}
VoiceAssistant *global_voice_assistant = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)

View File

@ -39,15 +39,10 @@ class IPAddressWiFiInfo : public PollingComponent, public text_sensor::TextSenso
class DNSAddressWifiInfo : public PollingComponent, public text_sensor::TextSensor {
public:
void update() override {
std::string dns_results;
auto dns_one = wifi::global_wifi_component->get_dns_address(0);
auto dns_two = wifi::global_wifi_component->get_dns_address(1);
dns_results += "DNS1: ";
dns_results += dns_one.str();
dns_results += " DNS2: ";
dns_results += dns_two.str();
std::string dns_results = dns_one.str() + " " + dns_two.str();
if (dns_results != this->last_results_) {
this->last_results_ = dns_results;

View File

@ -12,7 +12,7 @@ pyserial==3.5
platformio==6.1.13 # When updating platformio, also update Dockerfile
esptool==4.7.0
click==8.1.7
esphome-dashboard==20240319.0
esphome-dashboard==20240412.0
aioesphomeapi==23.2.0
zeroconf==0.131.0
python-magic==0.4.27

View File

@ -15,3 +15,5 @@ text_sensor:
- platform: ethernet_info
ip_address:
name: IP Address
dns_address:
name: DNS Address

View File

@ -15,3 +15,5 @@ text_sensor:
- platform: ethernet_info
ip_address:
name: IP Address
dns_address:
name: DNS Address

View File

@ -5,6 +5,7 @@ i2c:
sensor:
- platform: htu21d
model: htu21d
temperature:
name: Temperature
humidity:

View File

@ -5,6 +5,7 @@ i2c:
sensor:
- platform: htu21d
model: htu21d
temperature:
name: Temperature
humidity:

View File

@ -5,6 +5,7 @@ i2c:
sensor:
- platform: htu21d
model: htu21d
temperature:
name: Temperature
humidity:

View File

@ -5,6 +5,7 @@ i2c:
sensor:
- platform: htu21d
model: htu21d
temperature:
name: Temperature
humidity:

View File

@ -5,6 +5,7 @@ i2c:
sensor:
- platform: htu21d
model: htu21d
temperature:
name: Temperature
humidity:

View File

@ -5,6 +5,7 @@ i2c:
sensor:
- platform: htu21d
model: htu21d
temperature:
name: Temperature
humidity:

View File

@ -3,12 +3,146 @@ remote_receiver:
pin: ${pin}
rmt_channel: ${rmt_channel}
dump: all
on_abbwelcome:
then:
- logger.log:
format: "on_abbwelcome: %u"
args: ["x.data()[0]"]
on_aeha:
then:
- logger.log:
format: "on_aeha: %u %u"
args: ["x.address", "x.data.front()"]
on_byronsx:
then:
- logger.log:
format: "on_byronsx: %u %u"
args: ["x.address", "x.command"]
on_canalsat:
then:
- logger.log:
format: "on_canalsat: %u %u"
args: ["x.address", "x.command"]
# on_canalsatld:
# then:
# - logger.log:
# format: "on_canalsatld: %u %u"
# args: ["x.address", "x.command"]
on_coolix:
then:
delay: !lambda "return x.first + x.second;"
- logger.log:
format: "on_coolix: %u %u"
args: ["x.first", "x.second"]
on_dish:
then:
- logger.log:
format: "on_dish: %u %u"
args: ["x.address", "x.command"]
on_dooya:
then:
- logger.log:
format: "on_dooya: %u %u %u"
args: ["x.channel", "x.button", "x.check"]
on_drayton:
then:
- logger.log:
format: "on_drayton: %u %u %u"
args: ["x.address", "x.channel", "x.command"]
on_jvc:
then:
- logger.log:
format: "on_jvc: %u"
args: ["x.data"]
on_keeloq:
then:
- logger.log:
format: "on_keeloq: %u %u %u"
args: ["x.encrypted", "x.address", "x.command"]
on_haier:
then:
- logger.log:
format: "on_haier: %u"
args: ["x.data.front()"]
on_lg:
then:
- logger.log:
format: "on_lg: %u %u"
args: ["x.data", "x.nbits"]
on_magiquest:
then:
- logger.log:
format: "on_magiquest: %u %u"
args: ["x.magnitude", "x.wand_id"]
on_midea:
then:
- logger.log:
format: "on_midea: %u %u"
args: ["x.size()", "x.data()[0]"]
on_nec:
then:
- logger.log:
format: "on_nec: %u %u"
args: ["x.address", "x.command"]
on_nexa:
then:
- logger.log:
format: "on_nexa: %u %u %u %u %u"
args: ["x.device", "x.group", "x.state", "x.channel", "x.level"]
on_panasonic:
then:
- logger.log:
format: "on_panasonic: %u %u"
args: ["x.address", "x.command"]
on_pioneer:
then:
- logger.log:
format: "on_pioneer: %u %u"
args: ["x.rc_code_1", "x.rc_code_2"]
on_pronto:
then:
- logger.log:
format: "on_pronto: %s"
args: ["x.data.c_str()"]
on_raw:
then:
- logger.log:
format: "on_raw: %u"
args: ["x.front()"]
on_rc5:
then:
- logger.log:
format: "on_rc5: %u %u"
args: ["x.address", "x.command"]
on_rc6:
then:
- logger.log:
format: "on_rc6: %u %u"
args: ["x.address", "x.command"]
on_rc_switch:
then:
delay: !lambda "return uint32_t(x.code) + x.protocol;"
- logger.log:
format: "on_rc_switch: %llu %u"
args: ["x.code", "x.protocol"]
on_samsung:
then:
- logger.log:
format: "on_samsung: %llu %u"
args: ["x.data", "x.nbits"]
on_samsung36:
then:
- logger.log:
format: "on_samsung36: %u %u"
args: ["x.address", "x.command"]
on_sony:
then:
- logger.log:
format: "on_sony: %u %u"
args: ["x.data", "x.nbits"]
on_toshiba_ac:
then:
- logger.log:
format: "on_toshiba_ac: %llu %llu"
args: ["x.rc_code_1", "x.rc_code_2"]
on_mirage:
then:
- lambda: |-

View File

@ -2,12 +2,146 @@ remote_receiver:
id: rcvr
pin: GPIO5
dump: all
on_abbwelcome:
then:
- logger.log:
format: "on_abbwelcome: %u"
args: ["x.data()[0]"]
on_aeha:
then:
- logger.log:
format: "on_aeha: %u %u"
args: ["x.address", "x.data.front()"]
on_byronsx:
then:
- logger.log:
format: "on_byronsx: %u %u"
args: ["x.address", "x.command"]
on_canalsat:
then:
- logger.log:
format: "on_canalsat: %u %u"
args: ["x.address", "x.command"]
# on_canalsatld:
# then:
# - logger.log:
# format: "on_canalsatld: %u %u"
# args: ["x.address", "x.command"]
on_coolix:
then:
delay: !lambda "return x.first + x.second;"
- logger.log:
format: "on_coolix: %u %u"
args: ["x.first", "x.second"]
on_dish:
then:
- logger.log:
format: "on_dish: %u %u"
args: ["x.address", "x.command"]
on_dooya:
then:
- logger.log:
format: "on_dooya: %u %u %u"
args: ["x.channel", "x.button", "x.check"]
on_drayton:
then:
- logger.log:
format: "on_drayton: %u %u %u"
args: ["x.address", "x.channel", "x.command"]
on_jvc:
then:
- logger.log:
format: "on_jvc: %u"
args: ["x.data"]
on_keeloq:
then:
- logger.log:
format: "on_keeloq: %u %u %u"
args: ["x.encrypted", "x.address", "x.command"]
on_haier:
then:
- logger.log:
format: "on_haier: %u"
args: ["x.data.front()"]
on_lg:
then:
- logger.log:
format: "on_lg: %u %u"
args: ["x.data", "x.nbits"]
on_magiquest:
then:
- logger.log:
format: "on_magiquest: %u %u"
args: ["x.magnitude", "x.wand_id"]
on_midea:
then:
- logger.log:
format: "on_midea: %u %u"
args: ["x.size()", "x.data()[0]"]
on_nec:
then:
- logger.log:
format: "on_nec: %u %u"
args: ["x.address", "x.command"]
on_nexa:
then:
- logger.log:
format: "on_nexa: %u %u %u %u %u"
args: ["x.device", "x.group", "x.state", "x.channel", "x.level"]
on_panasonic:
then:
- logger.log:
format: "on_panasonic: %u %u"
args: ["x.address", "x.command"]
on_pioneer:
then:
- logger.log:
format: "on_pioneer: %u %u"
args: ["x.rc_code_1", "x.rc_code_2"]
on_pronto:
then:
- logger.log:
format: "on_pronto: %s"
args: ["x.data.c_str()"]
on_raw:
then:
- logger.log:
format: "on_raw: %u"
args: ["x.front()"]
on_rc5:
then:
- logger.log:
format: "on_rc5: %u %u"
args: ["x.address", "x.command"]
on_rc6:
then:
- logger.log:
format: "on_rc6: %u %u"
args: ["x.address", "x.command"]
on_rc_switch:
then:
delay: !lambda "return uint32_t(x.code) + x.protocol;"
- logger.log:
format: "on_rc_switch: %llu %u"
args: ["x.code", "x.protocol"]
on_samsung:
then:
- logger.log:
format: "on_samsung: %llu %u"
args: ["x.data", "x.nbits"]
on_samsung36:
then:
- logger.log:
format: "on_samsung36: %u %u"
args: ["x.address", "x.command"]
on_sony:
then:
- logger.log:
format: "on_sony: %u %u"
args: ["x.data", "x.nbits"]
on_toshiba_ac:
then:
- logger.log:
format: "on_toshiba_ac: %llu %llu"
args: ["x.rc_code_1", "x.rc_code_2"]
on_mirage:
then:
- lambda: |-

View File

@ -0,0 +1,18 @@
esphome:
name: componenttestespbk72xx
friendly_name: $component_name
bk72xx:
board: cb3s
logger:
level: VERY_VERBOSE
packages:
component_under_test: !include
file: $component_test_file
vars:
component_name: $component_name
test_name: $test_name
target_platform: $target_platform
component_test_file: $component_test_file