SwitchBotAPI icon indicating copy to clipboard operation
SwitchBotAPI copied to clipboard

hubDeviceId contains deviceId in the status of Plug Mini (JP)

Open myaaaaa-chan opened this issue 8 months ago • 1 comments

Analysis

When retrieving the status of the Plug Mini (JP) using the status retrieval API, the hubDeviceId and deviceId have the same value. It appears that the deviceId is being set to hubDeviceId.

Expected Behavior

{
  statusCode: 100,
  body: {
    deviceId: 'DCDA0CDXXXXX',
    deviceType: 'Plug Mini (JP)',
    hubDeviceId: 'F3131FAXXXXX',
    power: 'off',
    voltage: 102.2,
    weight: 0.4,
    electricityOfDay: 200,
    electricCurrent: 0.04,
    version: 'V1.8-1.8'
  },
  message: 'success'
}

Steps To Reproduce

"Retrieve the status of the Plug Mini (JP) using the status retrieval API (GET /v1.1/devices/{deviceId}/status)."

Logs

The response when retrieving the status of the Plug Mini (JP) using the status API.


{
  statusCode: 100,
  body: {
    deviceId: 'DCDA0CDXXXXX',
    deviceType: 'Plug Mini (JP)',
    hubDeviceId: 'DCDA0CDXXXXX',
    power: 'off',
    voltage: 102.2,
    weight: 0.4,
    electricityOfDay: 200,
    electricCurrent: 0.04,
    version: 'V1.8-1.8'
  },
  message: 'success'
}


### Configuration

```json
There are no relevant configurations.

Environment

  • OS: Rocky Linux release 9.4 (Blue Onyx)
  • Software: Next.js v14.2.3
  • Node:v20.14.0
  • npm:10.8.1

Additional Context

No response

myaaaaa-chan avatar Jun 20 '24 08:06 myaaaaa-chan