mirror of
https://github.com/esphome/esphome.git
synced 2025-09-08 06:12:20 +01:00
Clean-up string sanitation helpers (#2660)
This commit is contained in:
@@ -35,7 +35,7 @@ const std::string &EntityBase::get_object_id() { return this->object_id_; }
|
||||
|
||||
// Calculate Object ID Hash from Entity Name
|
||||
void EntityBase::calc_object_id_() {
|
||||
this->object_id_ = sanitize_string_allowlist(to_lowercase_underscore(this->name_), HOSTNAME_CHARACTER_ALLOWLIST);
|
||||
this->object_id_ = str_sanitize(str_snake_case(this->name_));
|
||||
// FNV-1 hash
|
||||
this->object_id_hash_ = fnv1_hash(this->object_id_);
|
||||
}
|
||||
|
Reference in New Issue
Block a user