TA2k / ioBroker.nissan

ioBroker Adapter for Nissan Connect
MIT License
6 stars 3 forks source link

typo in command to lock/unlock doors? #12

Open jumpjack opened 1 year ago

jumpjack commented 1 year ago

https://github.com/TA2k/ioBroker.nissan/blob/efe24f55144b005a9217eb624424b6044f4272bd/main.js#L708C13-L708C17

Shouldn't this be "action" : "lock" rather than "lock" : "lock" ? I don't have a Nissan I have a Renault, but if I use "lock" : "lock" I get error 400, "Http message is not readable", while with "action": "lock" I get "403", "Access is denied for this resource"

Additionally, I think target is missing:

"target": "driver_s_door",

or

'doorType': 'driver_s_door'

, it's not clear...

bolliy commented 4 months ago

I can't understand that. Since you are not using leaf, I will close the issue.

jumpjack commented 4 months ago

This payload is probably wrong:

    if (command === "lock-unlock") {
      data = {
        data: {
          type: this.convertToCamelCase(command),
          attributes: {
            lock: value ? "lock" : "unlock",
          },
        },
      };

I think it should be:

if (command === "lock-unlock") {
  data = {
    data: {
      type: this.convertToCamelCase(command),
      attributes: {
        action: value ? "lock" : "unlock",
      },
    },
  };
}
bolliy commented 4 months ago

I don't think so! See https://gitlab.com/tobiaswkjeldsen/dartnissanconnect/-/blob/master/lib/src/nissanconnect_vehicle.dart#L331

jumpjack commented 4 months ago

well, if it works, it works.