Sort save JSON on startup to make user editing less error-prone
This commit is contained in:
parent
8efb5c9907
commit
8e6d328710
|
@ -22,7 +22,7 @@ impl Settings {
|
|||
|
||||
impl From<SettingsJson> for Settings {
|
||||
fn from(mut other: SettingsJson) -> Self {
|
||||
match other.version {
|
||||
let mut result = match other.version {
|
||||
0 => Self {
|
||||
version: 1,
|
||||
enable: other.enable,
|
||||
|
@ -65,7 +65,9 @@ impl From<SettingsJson> for Settings {
|
|||
max: 100.0,
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
result.sort_curve();
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1,23 @@
|
|||
{"version": 0, "enable": true, "interpolate": true, "curve": [{"x": 0.2740740740740741, "y": 0.815}, {"x": 0.725925925925926, "y": 0.665}, {"x": 0.9074074074074074, "y": 0.08}]}
|
||||
{
|
||||
"version": 1,
|
||||
"enable": true,
|
||||
"interpolate": true,
|
||||
"curve": [
|
||||
{
|
||||
"x": 0.5074626865671642,
|
||||
"y": 0.225
|
||||
},
|
||||
{
|
||||
"x": 0.6902985074626866,
|
||||
"y": 0.795
|
||||
}
|
||||
],
|
||||
"fan_bounds": {
|
||||
"min": 1.0,
|
||||
"max": 7000.0
|
||||
},
|
||||
"temperature_bounds": {
|
||||
"min": 0.0,
|
||||
"max": 100.0
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue