Skip to content

Commit d7902aa

Browse files
committed
fix url
1 parent 6d05658 commit d7902aa

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

main.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -663,20 +663,18 @@ class Fiat extends utils.Adapter {
663663
command: command,
664664
pinAuth: this.pinAuth,
665665
};
666+
let url = '/v1/accounts/' + this.UID + '/vehicles/' + vin + '/' + action;
666667
if (command === 'CPPLUS') {
667668
try {
668669
data.schedule = JSON.parse(state.val);
670+
671+
url = '/v2/accounts/' + this.UID + '/vehicles/' + vin + '/ev/' + action;
669672
} catch (error) {
670673
this.log.error('Failed to parse schedule');
671674
this.log.error(error);
672675
}
673676
}
674-
this.getVehicleStatus(
675-
vin,
676-
'/v1/accounts/' + this.UID + '/vehicles/' + vin + '/' + action,
677-
null,
678-
JSON.stringify(data),
679-
)
677+
this.getVehicleStatus(vin, url, null, JSON.stringify(data))
680678
.then((data) => {
681679
if (data.responseStatus !== 'pending') {
682680
this.log.warn(JSON.stringify(data));

0 commit comments

Comments
 (0)