17#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_CONFIG
18 ESP_LOGCONFIG(TAG,
"Key Collector:");
20 ESP_LOGCONFIG(TAG,
" min length: %d", this->
min_length_);
23 ESP_LOGCONFIG(TAG,
" max length: %d", this->
max_length_);
37 " end key is required: %s",
44 ESP_LOGCONFIG(TAG,
" entry timeout: %0.1f", this->
timeout_ / 1000.0);
64 if (progress_update && had_state) {
106 if ((this->
max_length_ > 0) && (this->
result_.size() == this->max_length_) && (!this->end_key_required_)) {
void enable_loop()
Enable this component's loop.
void disable_loop()
Disable this component's loop.
constexpr const char * c_str() const
size_type find(const char *s, size_type pos=0) const
Find first occurrence of substring, returns std::string::npos if not found.
constexpr bool empty() const
LazyCallbackManager< void(const std::string &, uint8_t)> timeout_callbacks_
void set_enabled(bool enabled)
void send_key(uint8_t key)
void add_provider(key_provider::KeyProvider *provider)
LazyCallbackManager< void(const std::string &, uint8_t)> progress_callbacks_
void dump_config() override
void clear(bool progress_update=true)
LazyCallbackManager< void(const std::string &, uint8_t, uint8_t)> result_callbacks_
interface for components that provide keypresses
void add_on_key_callback(F &&callback)
ESPHOME_LOG_TAG(TAG, "key_collector")
uint32_t IRAM_ATTR HOT millis()