Remove last_reset_type and convert all those sensors to TOTAL_INCREASING (#2233)
This commit is contained in:
@@ -18,18 +18,6 @@ const char *state_class_to_string(StateClass state_class) {
|
||||
}
|
||||
}
|
||||
|
||||
const char *last_reset_type_to_string(LastResetType last_reset_type) {
|
||||
switch (last_reset_type) {
|
||||
case LAST_RESET_TYPE_NEVER:
|
||||
return "never";
|
||||
case LAST_RESET_TYPE_AUTO:
|
||||
return "auto";
|
||||
case LAST_RESET_TYPE_NONE:
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void Sensor::publish_state(float state) {
|
||||
this->raw_state = state;
|
||||
this->raw_callback_.call(state);
|
||||
@@ -80,7 +68,6 @@ void Sensor::set_state_class(const std::string &state_class) {
|
||||
ESP_LOGW(TAG, "'%s' - Unrecognized state class %s", this->get_name().c_str(), state_class.c_str());
|
||||
}
|
||||
}
|
||||
void Sensor::set_last_reset_type(LastResetType last_reset_type) { this->last_reset_type = last_reset_type; }
|
||||
std::string Sensor::get_unit_of_measurement() {
|
||||
if (this->unit_of_measurement_.has_value())
|
||||
return *this->unit_of_measurement_;
|
||||
|
||||
Reference in New Issue
Block a user