mirror of
https://github.com/esphome/esphome.git
synced 2025-09-05 04:42:21 +01:00
Drop deprecated entity property base methods (#4539)
This commit is contained in:
@@ -41,16 +41,13 @@ void BinarySensor::send_state_internal(bool state, bool is_initial) {
|
||||
this->state_callback_.call(state);
|
||||
}
|
||||
}
|
||||
std::string BinarySensor::device_class() { return ""; }
|
||||
|
||||
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_;
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
return this->device_class();
|
||||
#pragma GCC diagnostic pop
|
||||
return "";
|
||||
}
|
||||
void BinarySensor::add_filter(Filter *filter) {
|
||||
filter->parent_ = this;
|
||||
|
Reference in New Issue
Block a user