1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 04:42: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

@@ -43,12 +43,7 @@ void BinarySensor::send_state_internal(bool state, bool is_initial) {
}
BinarySensor::BinarySensor() : state(false) {}
void BinarySensor::set_device_class(const std::string &device_class) { this->device_class_ = device_class; }
std::string BinarySensor::get_device_class() {
if (this->device_class_.has_value())
return *this->device_class_;
return "";
}
void BinarySensor::add_filter(Filter *filter) {
filter->parent_ = this;
if (this->filter_list_ == nullptr) {