mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-05 20:38:27 +02:00
Implement more dump_configs (#791)
This commit is contained in:
@@ -98,6 +98,12 @@ void PZEM004T::write_state_(PZEM004T::PZEM004TReadState state) {
|
||||
this->write_array(data);
|
||||
this->read_state_ = state;
|
||||
}
|
||||
void PZEM004T::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "PZEM004T:");
|
||||
LOG_SENSOR("", "Voltage", this->voltage_sensor_);
|
||||
LOG_SENSOR("", "Current", this->current_sensor_);
|
||||
LOG_SENSOR("", "Power", this->power_sensor_);
|
||||
}
|
||||
|
||||
} // namespace pzem004t
|
||||
} // namespace esphome
|
||||
|
||||
@@ -17,6 +17,8 @@ class PZEM004T : public PollingComponent, public uart::UARTDevice {
|
||||
|
||||
void update() override;
|
||||
|
||||
void dump_config() override;
|
||||
|
||||
protected:
|
||||
sensor::Sensor *voltage_sensor_;
|
||||
sensor::Sensor *current_sensor_;
|
||||
|
||||
Reference in New Issue
Block a user