improve dump_config output of sensors.

This commit is contained in:
Your Name
2023-03-14 16:04:45 +01:00
parent 223b59a228
commit 3bc1015f79
6 changed files with 12 additions and 12 deletions

View File

@@ -5,7 +5,7 @@
namespace esphome {
namespace truma_inetbox {
static const char *const TAG = "truma_inetbox.binary_sensor";
static const char *const TAG = "truma_inetbox.cpplus_binary_sensor";
void TrumaCpPlusBinarySensor::update() {
if (this->parent_->get_lin_bus_fault() || (this->parent_->get_last_cp_plus_request() == 0)) {
@@ -16,6 +16,6 @@ void TrumaCpPlusBinarySensor::update() {
this->publish_state(micros() < timeout);
}
void TrumaCpPlusBinarySensor::dump_config() { ESP_LOGCONFIG("", "Truma CP Plus Binary Sensor"); }
void TrumaCpPlusBinarySensor::dump_config() { LOG_BINARY_SENSOR("", "Truma CP Plus Binary Sensor", this); }
} // namespace truma_inetbox
} // namespace esphome

View File

@@ -5,7 +5,7 @@
namespace esphome {
namespace truma_inetbox {
static const char *const TAG = "truma_inetbox.binary_sensor";
static const char *const TAG = "truma_inetbox.heater_binary_sensor";
void TrumaHeaterBinarySensor::setup() {
this->parent_->register_listener([this](const StatusFrameHeater *status_heater) {
@@ -37,7 +37,7 @@ void TrumaHeaterBinarySensor::setup() {
}
void TrumaHeaterBinarySensor::dump_config() {
ESP_LOGCONFIG("", "Truma Heater Binary Sensor");
LOG_BINARY_SENSOR("", "Truma Heater Binary Sensor", this);
ESP_LOGCONFIG(TAG, " Type '%s'", enum_to_c_str(this->type_));
}
} // namespace truma_inetbox

View File

@@ -5,7 +5,7 @@
namespace esphome {
namespace truma_inetbox {
static const char *const TAG = "truma_inetbox.binary_sensor";
static const char *const TAG = "truma_inetbox.timer_binary_sensor";
void TrumaTimerBinarySensor::setup() {
this->parent_->register_listener([this](const StatusFrameTimer *status_timer) {
@@ -26,7 +26,7 @@ void TrumaTimerBinarySensor::setup() {
}
void TrumaTimerBinarySensor::dump_config() {
ESP_LOGCONFIG("", "Truma Timer Binary Sensor");
LOG_BINARY_SENSOR("", "Truma Timer Binary Sensor", this);
ESP_LOGCONFIG(TAG, " Type %s", enum_to_c_str(this->type_));
}
} // namespace truma_inetbox