fix apparent power sometimes lower than active power

This commit is contained in:
unknown 2024-08-16 19:37:25 -07:00
parent 7d95472a4c
commit 80df581813

View file

@ -174,7 +174,7 @@ void CSE7766Component::parse_data_() {
} }
if (have_voltage && have_current) { if (have_voltage && have_current) {
const float apparent_power = voltage * current; const float apparent_power = max(voltage * current, power);
if (this->apparent_power_sensor_ != nullptr) { if (this->apparent_power_sensor_ != nullptr) {
this->apparent_power_sensor_->publish_state(apparent_power); this->apparent_power_sensor_->publish_state(apparent_power);
} }