1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-08 22:32:21 +01:00

Keep Device Class in Flash. (#4639)

* Keep Device Class in Flash.

* Remove blank line

---------

Co-authored-by: Your Name <you@example.com>
This commit is contained in:
Fabian
2023-04-20 05:53:35 +02:00
committed by GitHub
parent 0f7e34e7ec
commit afc2b3b74f
14 changed files with 31 additions and 76 deletions

View File

@@ -72,6 +72,16 @@ void EntityBase::calc_object_id_() {
this->object_id_hash_ = fnv1_hash(this->object_id_c_str_);
}
}
uint32_t EntityBase::get_object_id_hash() { return this->object_id_hash_; }
std::string EntityBase_DeviceClass::get_device_class() {
if (this->device_class_ == nullptr) {
return "";
}
return this->device_class_;
}
void EntityBase_DeviceClass::set_device_class(const char *device_class) { this->device_class_ = device_class; }
} // namespace esphome