Browse Source

settings: fixup 4abcec8a2b

- for some reason old key was default-constructible
- fix magnitude key generation
mcspr-patch-1
Maxim Prokhorov 3 years ago
parent
commit
660493a1db
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      code/espurna/sensor.cpp

+ 3
- 6
code/espurna/sensor.cpp View File

@ -1062,7 +1062,7 @@ const String _sensorQueryDefault(const String& key) {
case MAGNITUDE_ENERGY:
return {"pwrRatioE", magnitude.index_global};
default:
return {};
return "";
}
};
@ -2515,13 +2515,10 @@ void _sensorConfigure() {
// adjust type-specific units
{
const sensor::Unit default_unit { magnitude.sensor->units(magnitude.slot) };
const settings_key_t key {
const String key {
String(_magnitudeSettingsPrefix(magnitude.type)) + F("Units") + String(magnitude.index_global, 10) };
magnitude.units = _magnitudeUnitFilter(
magnitude,
getSetting(key, default_unit)
);
magnitude.units = _magnitudeUnitFilter(magnitude, getSetting(key, default_unit));
}
// some magnitudes allow to be corrected with an offset


Loading…
Cancel
Save