Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bolliy authored Jun 3, 2024
2 parents d59137d + 51046c0 commit ee95c6d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4,772 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Feel free to follow the discussions in the german [iobroker forum](https://forum
- (bolliy) ConnectEV: Update status before reading cachedeStatus
- (bolliy) ConnectEV: change adminUI to json (js-controller >= 5.0)

### 0.1.2 (2024-05-31)

- Refresh Token fix

### 0.1.1 (2024-05-20)

- Login fixed.
Expand Down
47 changes: 21 additions & 26 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
"name": "nissan",
"version": "0.1.1",
"news": {
"0.1.2": {
"en": "Refresh Token fix",
"de": "Refresh Token fix",
"ru": "Освещение Токена",
"pt": "Atualizar a correção Token",
"nl": "Tokenfix vernieuwen",
"fr": "Correction du jeton rafraîchi",
"it": "Refresh Token fix",
"es": "Refresh Token fix",
"pl": "Odśwież Token fix",
"uk": "Refresh Token виправити",
"zh-cn": "刷新调试修正"
},
"0.1.1": {
"en": "Login fixed.",
"de": "Login gefixt.",
Expand Down Expand Up @@ -67,32 +80,6 @@
"pl": "Dodaj opcję forceRefresh w ustawieniach. Napraw login i punkty końcowe",
"uk": "Додайте опцію forceRefresh у налаштуваннях. Виправте логін і кінцеві точки",
"zh-cn": "在设置中添加强制刷新选项。修复登录和端点"
},
"0.0.9": {
"en": "fix refresh token and enforce refresh",
"de": "Aktualisierungstoken reparieren und Aktualisierung erzwingen",
"ru": "исправить токен обновления и принудительно обновить",
"pt": "corrigir token de atualização e impor atualização",
"nl": "repareer het vernieuwingstoken en dwing vernieuwing af",
"fr": "corriger le jeton d'actualisation et appliquer l'actualisation",
"it": "correggere il token di aggiornamento e imporre l'aggiornamento",
"es": "arreglar el token de actualización y aplicar la actualización",
"pl": "napraw token odświeżania i wymuś odświeżanie",
"uk": "виправити маркер оновлення та примусове оновлення",
"zh-cn": "修复刷新令牌并强制刷新"
},
"0.0.8": {
"en": "fix 401 error, fix remote controls",
"de": "401-Fehler beheben, Fernbedienungen reparieren",
"ru": "исправить ошибку 401, исправить пульты дистанционного управления",
"pt": "corrigir erro 401, corrigir controles remotos",
"nl": "fix 401-fout, repareer afstandsbedieningen",
"fr": "corriger l'erreur 401, réparer les télécommandes",
"it": "correggere l'errore 401, correggere i telecomandi",
"es": "arreglar error 401, arreglar controles remotos",
"pl": "napraw błąd 401, napraw piloty",
"uk": "виправити помилку 401, виправити пульти дистанційного керування",
"zh-cn": "修复401错误,修复远程控制"
}
},
"titleLang": {
Expand Down Expand Up @@ -135,6 +122,14 @@
"link": "https://opensource.org/license/mit/",
"type": "free"
},
"authors": [
"TA2k <[email protected]>"
],
"keywords": [
"nissan",
"leaf"
],
"license": "MIT",
"platform": "Javascript/Node.js",
"icon": "nissan.png",
"enabled": true,
Expand Down
15 changes: 8 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ class Nissan extends utils.Adapter {
await this.requestClient({
method: 'post',
url: 'https://prod.eu2.auth.kamereon.org/kauth/oauth2/a-ncb-prod/access_token',
jar: this.cookieJar,
withCredentials: true,

headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
Accept: 'application/json',
Expand Down Expand Up @@ -591,15 +590,17 @@ class Nissan extends utils.Adapter {
await this.requestClient({
method: 'post',
url: 'https://prod.eu2.auth.kamereon.org/kauth/oauth2/a-ncb-prod/access_token',
jar: this.cookieJar,
withCredentials: true,

headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
Accept: 'application/json',
},
data:
'client_secret=QUUkg0oW5NXse7a2iFHVWZ4zXTvQEecKuXZ8447OqwvklIk6yvxMZy6nuDlBklLB&client_id=a-ncb-nc-android-prod&grant_type=refresh_token&refresh_token=' +
this.session.refresh_token,
data: qs.stringify({
client_id: 'a-ncb-nc-android-prod',
client_secret: '6GKIax7fGT5yPHuNmWNVOc4q5POBw1WRSW39ubRA8WPBmQ7MOxhm75EsmKMKENem',
grant_type: 'refresh_token',
refresh_token: this.session.refresh_token,
}),
})
.then((res) => {
this.log.debug('Refreshtoken success');
Expand Down
Loading

0 comments on commit ee95c6d

Please sign in to comment.