Re #3454: sensor persistent fixes (ported from master)

* Only clear sensor.persistentValue when the sensor.persistent is disabled and not on every shutdown.
* Only show persistent option for calculated type sensors (only these actually get saved in EEPROM)
This commit is contained in:
Damjan Adamic
2016-05-02 19:38:57 +02:00
parent 97cc58e323
commit 3fb853c8b8
5 changed files with 10 additions and 13 deletions
+1 -1
View File
@@ -619,7 +619,7 @@ void TelemetrySensorPanel::update()
ui->source4->setVisible(sources34FieldsDisplayed);
ui->autoOffset->setVisible(sensor.unit != SensorData::UNIT_RPMS && isConfigurable);
ui->filter->setVisible(isConfigurable);
ui->persistent->setVisible((sensor.type == SensorData::TELEM_TYPE_CALCULATED && sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION) || isConfigurable);
ui->persistent->setVisible(sensor.type == SensorData::TELEM_TYPE_CALCULATED);
lock = false;
}