mirror of
https://github.com/esphome/esphome.git
synced 2025-09-14 09:12:19 +01:00
Implement more dump_configs (#791)
This commit is contained in:
@@ -57,6 +57,15 @@ void PZEMAC::on_modbus_data(const std::vector<uint8_t> &data) {
|
||||
}
|
||||
|
||||
void PZEMAC::update() { this->send(PZEM_CMD_READ_IN_REGISTERS, 0, PZEM_REGISTER_COUNT); }
|
||||
void PZEMAC::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "PZEMAC:");
|
||||
ESP_LOGCONFIG(TAG, " Address: 0x%02X", this->address_);
|
||||
LOG_SENSOR("", "Voltage", this->voltage_sensor_);
|
||||
LOG_SENSOR("", "Current", this->current_sensor_);
|
||||
LOG_SENSOR("", "Power", this->power_sensor_);
|
||||
LOG_SENSOR("", "Frequency", this->frequency_sensor_);
|
||||
LOG_SENSOR("", "Power Factor", this->power_factor_sensor_);
|
||||
}
|
||||
|
||||
} // namespace pzemac
|
||||
} // namespace esphome
|
||||
|
@@ -19,6 +19,8 @@ class PZEMAC : public PollingComponent, public modbus::ModbusDevice {
|
||||
|
||||
void on_modbus_data(const std::vector<uint8_t> &data) override;
|
||||
|
||||
void dump_config() override;
|
||||
|
||||
protected:
|
||||
sensor::Sensor *voltage_sensor_;
|
||||
sensor::Sensor *current_sensor_;
|
||||
|
Reference in New Issue
Block a user