Keep Unit of Measurement in Flash. (#4719)
Co-authored-by: Your Name <you@example.com>
This commit is contained in:
1 parent
3c05ae4e1a
commit
535003014b
6 files changed
+22
-33
No files matched your search
@@ -22,15 +22,6 @@ std::string state_class_to_string(StateClass state_class) {
|
||||
|
||||
Sensor::Sensor() : state(NAN), raw_state(NAN) {}
|
||||
|
||||
std::string Sensor::get_unit_of_measurement() {
|
||||
if (this->unit_of_measurement_.has_value())
|
||||
return *this->unit_of_measurement_;
|
||||
return "";
|
||||
}
|
||||
void Sensor::set_unit_of_measurement(const std::string &unit_of_measurement) {
|
||||
this->unit_of_measurement_ = unit_of_measurement;
|
||||
}
|
||||
|
||||
int8_t Sensor::get_accuracy_decimals() {
|
||||
if (this->accuracy_decimals_.has_value())
|
||||
return *this->accuracy_decimals_;
|
||||
|
||||
Reference in new issue
Block a user