diff --git a/backend-rs/src/datastructs.rs b/backend-rs/src/datastructs.rs index e5d3b04..c9973f5 100644 --- a/backend-rs/src/datastructs.rs +++ b/backend-rs/src/datastructs.rs @@ -22,7 +22,7 @@ impl Settings { impl From 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 for Settings { max: 100.0, }, } - } + }; + result.sort_curve(); + result } } diff --git a/fantastic.json b/fantastic.json index 0956d87..c86bc59 100644 --- a/fantastic.json +++ b/fantastic.json @@ -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}]} \ No newline at end of file +{ + "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 + } +} \ No newline at end of file