Fix HLW8012 sensor not returning values if change_mode_every is set to never (#8456)

This commit is contained in:
Jannik 2025-05-01 03:12:51 +02:00 committed by GitHub
parent 9dcf295df8
commit 9a9b91b180
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,7 +69,7 @@ void HLW8012Component::update() {
float power = cf_hz * this->power_multiplier_;
if (this->change_mode_at_ != 0) {
if (this->change_mode_at_ != 0 || this->change_mode_every_ == 0) {
// Only read cf1 after one cycle. Apparently it's quite unstable after being changed.
if (this->current_mode_) {
float current = cf1_hz * this->current_multiplier_;