Apollon77 / daikin-controller-cloud

Connect and Control Daikin Cloud devices
MIT License
96 stars 26 forks source link

Support more API responses #143

Closed JeroenVdb closed 2 weeks ago

JeroenVdb commented 2 weeks ago

Some calls respond with other response codes then we already check. I checked the API docs and added all possible responses.

I also output the complete body response, it contains helpful error codes. For example:

{
  "code": "GATEWAY_DEVICE_MISSING",
  "message": "Could not find gateway device"
}

Docs: https://developer.cloud.daikineurope.com/spec/b0dffcaa-7b51-428a-bdff-a7c8a64195c0/70b10aca-1b4c-470b-907d-56879784ea9c#/info/get_info

Error: Unexpected API error, statusCode: 204
    at OnectaClient.requestResource (/Users/jvandenberghe/Projects/homebridge-daikin-cloud/node_modules/daikin-controller-cloud/src/onecta/oidc-client.ts:160:23)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at daikinAirConditioningAccessory.handleRotationSpeedSet (/Users/jvandenberghe/Projects/homebridge-daikin-cloud/src/daikinAirConditioningAccessory.ts:242:13)
JeroenVdb commented 2 weeks ago

Should fix: https://github.com/JeroenVdb/homebridge-daikin-cloud/issues/55#issuecomment-2208641150