Skip to content

Commit

Permalink
Added dynamic delay mechanism for Non-NASA protocol registration
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfaruk-aran committed Nov 1, 2024
1 parent 02a46ac commit 5a76591
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/samsung_ac/protocol_non_nasa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ namespace esphome
{
// Get the current time
const uint32_t now = millis();
if (start_millis == 0)
{
start_millis = millis();
}

// Dynamic delay on startup
static uint32_t dynamic_delay_interval = 10000; // Initial delay: 10 seconds
Expand Down
3 changes: 3 additions & 0 deletions components/samsung_ac/protocol_non_nasa.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ namespace esphome

void publish_request(MessageTarget *target, const std::string &address, ProtocolRequest &request) override;
void protocol_update(MessageTarget *target) override;

private:
uint32_t start_millis;
};
} // namespace samsung_ac
} // namespace esphome

0 comments on commit 5a76591

Please sign in to comment.