bytedance: g220a: virtual-sensor: Add associations
Add virtual sensor's associations so that the sensors could be shown in
Redfish and WebUI.
Tested: Verify the Total_Power is shown in Redfish as below
$ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/G220A/Sensors/Total_Power
{
"@odata.id": "/redfish/v1/Chassis/G220A/Sensors/Total_Power",
"@odata.type": "#Sensor.v1_0_0.Sensor",
"Id": "Total_Power",
"Name": "Total Power",
"Reading": 514.0,
"ReadingRangeMax": null,
"ReadingRangeMin": null,
"ReadingType": "Power",
"ReadingUnits": "W",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I0c9c84917364cad701f00fc3041d427a6e8750bc
diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json
index 6610184..dec59d5 100644
--- a/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json
+++ b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json
@@ -5,6 +5,14 @@
"Name": "total_power",
"SensorType": "power"
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -35,6 +43,14 @@
"Name": "P0_DIMM_VR_Pwr",
"SensorType": "power"
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -65,6 +81,14 @@
"Name": "P1_DIMM_VR_Pwr",
"SensorType": "power"
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -95,6 +119,14 @@
"Name": "CPU0_VR_Pwr",
"SensorType": "power"
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -133,6 +165,14 @@
"Name": "CPU1_VR_Pwr",
"SensorType": "power"
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -176,6 +216,14 @@
"CriticalHigh": 125,
"WarningHigh": 105
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -211,6 +259,14 @@
"CriticalHigh": 125,
"WarningHigh": 105
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -246,6 +302,14 @@
"CriticalHigh": 125,
"WarningHigh": 105
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":
@@ -289,6 +353,14 @@
"CriticalHigh": 125,
"WarningHigh": 105
},
+ "Associations":
+ [
+ [
+ "chassis",
+ "all_sensors",
+ "/xyz/openbmc_project/inventory/system/board/G220A"
+ ]
+ ],
"Params":
{
"DbusParam":