mirror of
https://github.com/esphome/esphome.git
synced 2025-09-08 06:12:20 +01:00
EntityBase: Icon string can stay in flash. (#4566)
* Icon string can stay in flash. * Remove redundant const. --------- Co-authored-by: Your Name <you@example.com>
This commit is contained in:
@@ -23,8 +23,13 @@ bool EntityBase::is_disabled_by_default() const { return this->disabled_by_defau
|
||||
void EntityBase::set_disabled_by_default(bool disabled_by_default) { this->disabled_by_default_ = disabled_by_default; }
|
||||
|
||||
// Entity Icon
|
||||
const std::string &EntityBase::get_icon() const { return this->icon_; }
|
||||
void EntityBase::set_icon(const std::string &name) { this->icon_ = name; }
|
||||
std::string EntityBase::get_icon() const {
|
||||
if (this->icon_c_str_ == nullptr) {
|
||||
return "";
|
||||
}
|
||||
return this->icon_c_str_;
|
||||
}
|
||||
void EntityBase::set_icon(const char *icon) { this->icon_c_str_ = icon; }
|
||||
|
||||
// Entity Category
|
||||
EntityCategory EntityBase::get_entity_category() const { return this->entity_category_; }
|
||||
|
Reference in New Issue
Block a user