diff --git a/hal-core/resources/web/api/openapi.json b/hal-core/resources/web/api/openapi.json
index 4f512162..a3dbf042 100644
--- a/hal-core/resources/web/api/openapi.json
+++ b/hal-core/resources/web/api/openapi.json
@@ -19,6 +19,7 @@
"type": "object",
"$ref": "#/components/schemas/dataClass"
},
+ "dataType": {"type": "string"},
"name": {"type": "string"},
"id": {"type": "integer"},
"map": {
@@ -29,7 +30,8 @@
"config": {
"type": "object",
"$ref": "#/components/schemas/configClass"
- }
+ },
+ "configType": {"type": "string"}
}
},
@@ -86,8 +88,6 @@
"configClass": {
"type": "object",
"properties": {
- "typeConfig": {"type": "string"},
- "typeData": {"type": "string"}
}
},
@@ -198,7 +198,7 @@
"type": "string"
},
"in": "query",
- "name": "typeConfig",
+ "name": "configType",
"required": false
},
{
@@ -206,7 +206,7 @@
"type": "string"
},
"in": "query",
- "name": "typeData",
+ "name": "dataType",
"required": false
}
]
@@ -276,7 +276,7 @@
"type": "string"
},
"in": "query",
- "name": "typeConfig",
+ "name": "configType",
"required": false
},
{
@@ -284,7 +284,7 @@
"type": "string"
},
"in": "query",
- "name": "typeData",
+ "name": "dataType",
"required": false
},
{
diff --git a/hal-core/resources/web/event_overview.tmpl b/hal-core/resources/web/event_overview.tmpl
index 130250a6..9fd32adb 100644
--- a/hal-core/resources/web/event_overview.tmpl
+++ b/hal-core/resources/web/event_overview.tmpl
@@ -57,7 +57,7 @@
// Only update if data has changed
row.dataset.deviceId = deviceData.id;
row.cells[0].innerHTML = "" + deviceData.name + "";
- row.cells[1].innerHTML = deviceData.config?.typeConfig;
+ row.cells[1].innerHTML = deviceData.configType;
row.cells[2].innerHTML = deviceData.data?.valueStr;
row.dataset.timestamp = deviceData.data?.timestamp;
@@ -65,7 +65,7 @@
$(row.cells[3]).relTimestamp();
var actionHtml = "";
- switch (deviceData.config?.typeData) {
+ switch (deviceData.dataType) {
case "ColorEventData":
actionHtml =
'' +
diff --git a/hal-core/src/se/hal/intf/HalAbstractDevice.java b/hal-core/src/se/hal/intf/HalAbstractDevice.java
index d934af9e..c1d9d7fa 100644
--- a/hal-core/src/se/hal/intf/HalAbstractDevice.java
+++ b/hal-core/src/se/hal/intf/HalAbstractDevice.java
@@ -244,27 +244,32 @@ public abstract class HalAbstractDevice sensors = new ArrayList<>();
@@ -60,14 +60,14 @@ public class SensorApiEndpoint extends HalApiEndpoint {
}
// device type filtering
- if (!ObjectUtil.isEmpty(reqTypeConfig) &&
- !sensor.getDeviceConfig().getClass().getSimpleName().equals(reqTypeConfig)) {
+ if (!ObjectUtil.isEmpty(reqConfigType) &&
+ !sensor.getDeviceConfig().getClass().getSimpleName().equals(reqConfigType)) {
filter_match = false;
}
// data type filtering
- if (!ObjectUtil.isEmpty(reqTypeData) &&
- !sensor.getDeviceConfig().getDeviceDataClass().getSimpleName().equals(reqTypeData)) {
+ if (!ObjectUtil.isEmpty(reqDataType) &&
+ !sensor.getDeviceConfig().getDeviceDataClass().getSimpleName().equals(reqDataType)) {
filter_match = false;
}
@@ -118,6 +118,7 @@ public class SensorApiEndpoint extends HalApiEndpoint {
deviceNode.set("aggregate", aggregateNode);
}
+ deviceNode.set("type", "Sensor");
root.add(deviceNode);
}