Description
The GraphQL API returns hardcoded/fake UPS data when querying upsDevices even when no UPS device is actually connected to the system.
Steps to Reproduce
- Have
apcupsd installed but no UPS device connected
- Query the
upsDevices GraphQL endpoint
Expected Behavior
The API should return an empty array [] or indicate that no UPS is available.
Actual Behavior
The API returns:
{
"data": {
"upsDevices": [
{
"id": "ups1",
"name": "My UPS",
"model": "APC Back-UPS Pro 1500",
"status": "COMMLOST",
"battery": {
"chargeLevel": 100,
"estimatedRuntime": 3600,
"health": "Good"
},
"power": {
"inputVoltage": 120.5,
"outputVoltage": 120.5,
"loadPercentage": 25
}
}
]
}
}
Impact
Client applications display a phantom UPS card with fake data ("My UPS" / "APC Back-UPS Pro 1500") to users who don't actually have a UPS device connected.
Thank you!
Description
The GraphQL API returns hardcoded/fake UPS data when querying
upsDeviceseven when no UPS device is actually connected to the system.Steps to Reproduce
apcupsdinstalled but no UPS device connectedupsDevicesGraphQL endpointExpected Behavior
The API should return an empty array
[]or indicate that no UPS is available.Actual Behavior
The API returns:
{ "data": { "upsDevices": [ { "id": "ups1", "name": "My UPS", "model": "APC Back-UPS Pro 1500", "status": "COMMLOST", "battery": { "chargeLevel": 100, "estimatedRuntime": 3600, "health": "Good" }, "power": { "inputVoltage": 120.5, "outputVoltage": 120.5, "loadPercentage": 25 } } ] } }Impact
Client applications display a phantom UPS card with fake data ("My UPS" / "APC Back-UPS Pro 1500") to users who don't actually have a UPS device connected.
Thank you!