mirror of
https://github.com/esphome/esphome.git
synced 2026-02-18 15:35:59 -07:00
tweak
This commit is contained in:
@@ -866,7 +866,7 @@ uint16_t APIConnection::try_send_text_info(EntityBase *entity, APIConnection *co
|
||||
msg.mode = static_cast<enums::TextMode>(text->traits.get_mode());
|
||||
msg.min_length = text->traits.get_min_length();
|
||||
msg.max_length = text->traits.get_max_length();
|
||||
msg.set_pattern(text->traits.get_pattern_ref());
|
||||
msg.set_pattern(text->traits.get_pattern_c_str());
|
||||
return fill_and_encode_entity_info(text, msg, ListEntitiesTextResponse::MESSAGE_TYPE, conn, remaining_size,
|
||||
is_single);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "esphome/core/string_ref.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace text {
|
||||
|
||||
@@ -24,7 +22,6 @@ class TextTraits {
|
||||
void set_pattern(const char *pattern) { this->pattern_ = pattern; }
|
||||
std::string get_pattern() const { return std::string(this->pattern_); }
|
||||
const char *get_pattern_c_str() const { return this->pattern_; }
|
||||
StringRef get_pattern_ref() const { return StringRef(this->pattern_); }
|
||||
|
||||
// Set/get the frontend mode.
|
||||
void set_mode(TextMode mode) { this->mode_ = mode; }
|
||||
|
||||
Reference in New Issue
Block a user