schemas: legacy: extract CFMSensor schema
This allows to remove some properties from 'Aggregate' schema which are
no longer needed, since there is now a more specific schema to use.
Tested: Schema Validator Pass
Change-Id: I2f3372d8d0b58226b06fdb4a0b66453395de8ef4
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/schemas/global.json b/schemas/global.json
index 57bbd61..2bbc023 100644
--- a/schemas/global.json
+++ b/schemas/global.json
@@ -43,6 +43,9 @@
"$ref": "legacy.json#/$defs/ExitAirTempSensor"
},
{
+ "$ref": "legacy.json#/$defs/CFMSensor"
+ },
+ {
"$ref": "virtual_sensor.json#/$defs/VirtualSensor"
},
{
diff --git a/schemas/legacy.json b/schemas/legacy.json
index 13cfdfa..fd46e00 100644
--- a/schemas/legacy.json
+++ b/schemas/legacy.json
@@ -46,6 +46,38 @@
],
"type": "object"
},
+ "CFMSensor": {
+ "additionalProperties": false,
+ "properties": {
+ "C1": {
+ "$ref": "#/$defs/Types/C1"
+ },
+ "C2": {
+ "$ref": "#/$defs/Types/C2"
+ },
+ "MaxCFM": {
+ "$ref": "#/$defs/Types/MaxCFM"
+ },
+ "TachMaxPercent": {
+ "$ref": "#/$defs/Types/TachMaxPercent"
+ },
+ "TachMinPercent": {
+ "$ref": "#/$defs/Types/TachMinPercent"
+ },
+ "Tachs": {
+ "$ref": "#/$defs/Types/Tachs"
+ },
+ "Name": {
+ "$ref": "#/$defs/Types/Name"
+ },
+ "Type": {
+ "type": "string",
+ "const": "CFMSensor"
+ }
+ },
+ "required": ["Name", "Type"],
+ "type": "object"
+ },
"Aggregate": {
"description": "Don't add additional properties to this schema. Consult README.schema for instructions on adding new Exposes element sub-schema.",
"additionalProperties": false,
@@ -65,12 +97,6 @@
"Bus": {
"$ref": "#/$defs/Types/Bus"
},
- "C1": {
- "$ref": "#/$defs/Types/C1"
- },
- "C2": {
- "$ref": "#/$defs/Types/C2"
- },
"CPURequired": {
"$ref": "#/$defs/Types/CPURequired"
},
@@ -119,9 +145,6 @@
"Labels": {
"$ref": "#/$defs/Types/Labels"
},
- "MaxCFM": {
- "$ref": "#/$defs/Types/MaxCFM"
- },
"MaxReading": {
"$ref": "#/$defs/Types/MaxReading"
},
@@ -236,12 +259,6 @@
"SlotId": {
"$ref": "#/$defs/Types/SlotId"
},
- "TachMaxPercent": {
- "$ref": "#/$defs/Types/TachMaxPercent"
- },
- "TachMinPercent": {
- "$ref": "#/$defs/Types/TachMinPercent"
- },
"Tachs": {
"$ref": "#/$defs/Types/Tachs"
},
@@ -2084,7 +2101,6 @@
"MultiNodeID",
"MultiNodePresence",
"PSUPresence",
- "CFMSensor",
"Intel HSBP CPLD",
"IntelHsbpFruDevice",
"IntelHsbpTempSensor",