diff --git a/devices/generic/items/state_consumption_2_item.json b/devices/generic/items/state_consumption_2_item.json index 405c5b4622..f5939e1148 100644 --- a/devices/generic/items/state_consumption_2_item.json +++ b/devices/generic/items/state_consumption_2_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/consumption_2", - "datatype": "Double", + "datatype": "UInt64", "access": "RW", "public": true, "description": "The measured consumption (in Wh).", diff --git a/devices/generic/items/state_consumption_item.json b/devices/generic/items/state_consumption_item.json index f5f879904c..bff5b237f3 100644 --- a/devices/generic/items/state_consumption_item.json +++ b/devices/generic/items/state_consumption_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/consumption", - "datatype": "Double", + "datatype": "UInt64", "access": "RW", "public": true, "description": "The measured consumption (in Wh).", diff --git a/devices/generic/items/state_current_item.json b/devices/generic/items/state_current_item.json index 4df20cf3bb..8ccb6843bd 100644 --- a/devices/generic/items/state_current_item.json +++ b/devices/generic/items/state_current_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/current", - "datatype": "Double", + "datatype": "UInt16", "access": "RW", "public": true, "description": "The measured current (in mA).", diff --git a/devices/generic/items/state_current_p1_item.json b/devices/generic/items/state_current_p1_item.json index 8f1dd36a8e..07941aea5f 100644 --- a/devices/generic/items/state_current_p1_item.json +++ b/devices/generic/items/state_current_p1_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/current_P1", - "datatype": "Double", + "datatype": "UInt16", "access": "RW", "public": true, "description": "The measured current on phase 1.", diff --git a/devices/generic/items/state_current_p2_item.json b/devices/generic/items/state_current_p2_item.json index 5eb780efcb..829b402a58 100644 --- a/devices/generic/items/state_current_p2_item.json +++ b/devices/generic/items/state_current_p2_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/current_P2", - "datatype": "Double", + "datatype": "UInt16", "access": "RW", "public": true, "description": "The measured current on phase 2.", diff --git a/devices/generic/items/state_current_p3_item.json b/devices/generic/items/state_current_p3_item.json index 028b84e62a..fceb97c6b5 100644 --- a/devices/generic/items/state_current_p3_item.json +++ b/devices/generic/items/state_current_p3_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/current_P3", - "datatype": "Double", + "datatype": "UInt16", "access": "RW", "public": true, "description": "The measured current on phase 3.", diff --git a/devices/generic/items/state_power_item.json b/devices/generic/items/state_power_item.json index ecdb7f71b4..a1924b19b5 100644 --- a/devices/generic/items/state_power_item.json +++ b/devices/generic/items/state_power_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/power", - "datatype": "Double", + "datatype": "Int16", "access": "RW", "public": true, "description": "The measured power (in W).", diff --git a/devices/generic/items/state_pressure_bis_item.json b/devices/generic/items/state_pressure_bis_item.json index c0b44edb7a..efd1264f39 100644 --- a/devices/generic/items/state_pressure_bis_item.json +++ b/devices/generic/items/state_pressure_bis_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/pressure_bis", - "datatype": "Double", + "datatype": "Int16", "access": "R", "public": false, "description": "The current air pressure (hPa)." diff --git a/devices/generic/items/state_pressure_item.json b/devices/generic/items/state_pressure_item.json index e27d6e761c..6a0feebba2 100644 --- a/devices/generic/items/state_pressure_item.json +++ b/devices/generic/items/state_pressure_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/pressure", - "datatype": "Double", + "datatype": "Int16", "access": "R", "public": true, "description": "The current air pressure (hPa).", diff --git a/devices/generic/items/state_production_item.json b/devices/generic/items/state_production_item.json index cbbe0f5d9a..62c23aaf5f 100644 --- a/devices/generic/items/state_production_item.json +++ b/devices/generic/items/state_production_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/production", - "datatype": "Double", + "datatype": "UInt64", "access": "RW", "public": true, "description": "The measured production (in Wh).", diff --git a/devices/generic/items/state_voltage_item.json b/devices/generic/items/state_voltage_item.json index 2de68c8070..c60758bac8 100644 --- a/devices/generic/items/state_voltage_item.json +++ b/devices/generic/items/state_voltage_item.json @@ -1,7 +1,7 @@ { "schema": "resourceitem1.schema.json", "id": "state/voltage", - "datatype": "Double", + "datatype": "UInt16", "access": "RW", "public": true, "description": "The measured voltage (in V).", diff --git a/resource.cpp b/resource.cpp index 55147f6329..22ab26dae5 100644 --- a/resource.cpp +++ b/resource.cpp @@ -434,13 +434,13 @@ void initResourceDescriptors() rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateCarbonMonoxide)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateCharging)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeString, QVariant::String, RStateColorMode)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateConsumption)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateConsumption_2)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt64, QVariant::Double, RStateConsumption)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt64, QVariant::Double, RStateConsumption_2)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStateCt)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateCurrent)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateCurrent_P1)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateCurrent_P2)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateCurrent_P3)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStateCurrent)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStateCurrent_P1)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStateCurrent_P2)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStateCurrent_P3)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateDark)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateDaylight)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt32, QVariant::Double, RStateDeviceRunTime)); @@ -482,13 +482,13 @@ void initResourceDescriptors() rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt16, QVariant::Double, RStateOrientationZ)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStatePM2_5)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeString, QVariant::String, RStatePanel)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStatePower)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt16, QVariant::Double, RStatePower)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStatePowerDivisor)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStatePresence)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeString, QVariant::String, RStatePresenceEvent)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStatePressure)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStatePressureBis)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateProduction)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt16, QVariant::Double, RStatePressure, 0, 32767)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt16, QVariant::Double, RStatePressureBis, 0, 32767)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt64, QVariant::Double, RStateProduction)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateReachable)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateReplaceFilter)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt8, QVariant::Double, RStateRotaryEvent)); @@ -512,7 +512,7 @@ void initResourceDescriptors() rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt8, QVariant::Double, RStateValve)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateVibration)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStateVibrationStrength)); - rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeReal, QVariant::Double, RStateVoltage)); + rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, QVariant::Double, RStateVoltage)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateWater)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, QVariant::Bool, RStateWaterBis)); rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeString, QVariant::String, RStateWindowOpen));