Solved incessant update() call rate.

This commit is contained in:
Victor Chang
2024-06-07 00:59:48 -07:00
parent 2aac3047ef
commit 148fb80440
2 changed files with 3 additions and 5 deletions

View File

@@ -16,11 +16,7 @@ void EmporiaVueUtility::setup() {
}
void EmporiaVueUtility::update() {
// This seems to be called incessantly instead of at the set update
// interval...
//ESP_LOGD(TAG, "Got update call with an instructed interval of
// %d sec", this->update_interval_);
// TODO: Use this to return value updates.
}
void EmporiaVueUtility::loop() {
@@ -160,6 +156,7 @@ void EmporiaVueUtility::dump_config() {
ESP_LOGCONFIG(TAG, " MGM Firmware Version: %d", this->mgm_firmware_ver);
ESP_LOGCONFIG(TAG, " MGM MAC Address: %s", this->mgm_mac_address);
ESP_LOGCONFIG(TAG, " MGM Install Code: %s (secret)", this->mgm_install_code);
LOG_UPDATE_INTERVAL(this);
}
} // namespace emporia_vue_utility
} // namespace esphome

View File

@@ -131,6 +131,7 @@ class EmporiaVueUtility : public PollingComponent, public uart::UARTDevice {
uint16_t cost_unit = 0;
void set_update_interval(uint32_t update_interval) {
PollingComponent::set_update_interval(update_interval);
update_interval_ = update_interval / 1000;
}
void set_power_sensor(sensor::Sensor *sensor) { power_sensor_ = sensor; }