Fix compilation for uponor_smatrix without time component (#6389)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Stefan Rado 2024-03-17 22:00:07 +01:00 committed by Jesse Hills
parent 9e378189c3
commit 3908a9ce9d
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A
2 changed files with 4 additions and 0 deletions

View file

@ -61,9 +61,11 @@ void UponorSmatrixComponent::loop() {
// Send packets during bus silence // Send packets during bus silence
if ((now - this->last_rx_ > 300) && (now - this->last_poll_start_ < 9500) && (now - this->last_tx_ > 200)) { if ((now - this->last_rx_ > 300) && (now - this->last_poll_start_ < 9500) && (now - this->last_tx_ > 200)) {
#ifdef USE_TIME
// Only build time packet when bus is silent and queue is empty to make sure we can send it right away // Only build time packet when bus is silent and queue is empty to make sure we can send it right away
if (this->send_time_requested_ && this->tx_queue_.empty() && this->do_send_time_()) if (this->send_time_requested_ && this->tx_queue_.empty() && this->do_send_time_())
this->send_time_requested_ = false; this->send_time_requested_ = false;
#endif
// Send the next packet in the queue // Send the next packet in the queue
if (!this->tx_queue_.empty()) { if (!this->tx_queue_.empty()) {
auto packet = std::move(this->tx_queue_.front()); auto packet = std::move(this->tx_queue_.front());

View file

@ -4,6 +4,8 @@
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/helpers.h" #include "esphome/core/helpers.h"
#include "esphome/core/defines.h"
#ifdef USE_TIME #ifdef USE_TIME
#include "esphome/components/time/real_time_clock.h" #include "esphome/components/time/real_time_clock.h"
#include "esphome/core/time.h" #include "esphome/core/time.h"