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
-7
View File
@@ -63,13 +63,6 @@ void Switch::add_on_state_callback(std::function<void(bool)> &&callback) {
void Switch::set_inverted(bool inverted) { this->inverted_ = inverted; }
bool Switch::is_inverted() const { return this->inverted_; }
std::string Switch::get_device_class() {
if (this->device_class_.has_value())
return *this->device_class_;
return "";
}
void Switch::set_device_class(const std::string &device_class) { this->device_class_ = device_class; }
void log_switch(const char *tag, const char *prefix, const char *type, Switch *obj) {
if (obj != nullptr) {
ESP_LOGCONFIG(tag, "%s%s '%s'", prefix, type, obj->get_name().c_str());