tuya: add time sync callback only once to prevent memleak (#5234)

This commit is contained in:
Kjell Braden
2023-08-13 23:09:51 +02:00
committed by GitHub
parent 08013be6dd
commit 4c1af007ca
2 changed files with 8 additions and 2 deletions
+1
View File
@@ -130,6 +130,7 @@ class Tuya : public Component, public uart::UARTDevice {
#ifdef USE_TIME
void send_local_time_();
optional<time::RealTimeClock *> time_id_{};
bool time_sync_callback_registered_{false};
#endif
TuyaInitState init_state_ = TuyaInitState::INIT_HEARTBEAT;
bool init_failed_{false};