Skip to content

Commit

Permalink
update dep
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Nov 19, 2024
1 parent 52f7a6f commit 57c9e61
Show file tree
Hide file tree
Showing 9 changed files with 524 additions and 592 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

40 changes: 0 additions & 40 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: ioBroker/testing-action-check@v1
with:
node-version: "20.x"
node-version: "22.x"
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
# install-command: 'npm install'
lint: true
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18.x, 20.x, 21.x]
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
Expand Down
75 changes: 38 additions & 37 deletions admin/words.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
//eslint-disable-next-line
/*global systemDictionary:true */
"use strict";

systemDictionary = {
"mercedesme adapter settings": {
"en": "Adapter settings for mercedesme",
"de": "Adaptereinstellungen für mercedesme",
"ru": "Настройки адаптера для mercedesme",
"pt": "Configurações do adaptador para mercedesme",
"nl": "Adapterinstellingen voor mercedesme",
"fr": "Paramètres d'adaptateur pour mercedesme",
"it": "Impostazioni dell'adattatore per mercedesme",
"es": "Ajustes del adaptador para mercedesme",
"pl": "Ustawienia adaptera dla mercedesme",
"zh-cn": "mercedesme的适配器设置"
},
"option1": {
"en": "option1",
"de": "Option 1",
"ru": "Опция 1",
"pt": "Opção 1",
"nl": "Optie 1",
"fr": "Option 1",
"it": "opzione 1",
"es": "Opción 1",
"pl": "opcja 1",
"zh-cn": "选项1"
},
"option2": {
"en": "option2",
"de": "Option 2",
"ru": "option2",
"pt": "opção 2",
"nl": "Optie 2",
"fr": "Option 2",
"it": "opzione 2",
"es": "opcion 2",
"pl": "Opcja 2",
"zh-cn": "选项2"
}
};
"mercedesme adapter settings": {
en: "Adapter settings for mercedesme",
de: "Adaptereinstellungen für mercedesme",
ru: "Настройки адаптера для mercedesme",
pt: "Configurações do adaptador para mercedesme",
nl: "Adapterinstellingen voor mercedesme",
fr: "Paramètres d'adaptateur pour mercedesme",
it: "Impostazioni dell'adattatore per mercedesme",
es: "Ajustes del adaptador para mercedesme",
pl: "Ustawienia adaptera dla mercedesme",
"zh-cn": "mercedesme的适配器设置",
},
option1: {
en: "option1",
de: "Option 1",
ru: "Опция 1",
pt: "Opção 1",
nl: "Optie 1",
fr: "Option 1",
it: "opzione 1",
es: "Opción 1",
pl: "opcja 1",
"zh-cn": "选项1",
},
option2: {
en: "option2",
de: "Option 2",
ru: "option2",
pt: "opção 2",
nl: "Optie 2",
fr: "Option 2",
it: "opzione 2",
es: "opcion 2",
pl: "Opcja 2",
"zh-cn": "选项2",
},
};
56 changes: 56 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const globals = require("globals");
const js = require("@eslint/js");

const { FlatCompat } = require("@eslint/eslintrc");

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

module.exports = [
{
ignores: ["**/build/", "**/.prettierrc.js", "**/.eslintrc.js", "**/Proto/"],
},
...compat.extends("eslint:recommended"),
{
plugins: {},

languageOptions: {
globals: {
...globals.node,
...globals.mocha,
},

ecmaVersion: 2020,
sourceType: "commonjs",
},

rules: {
indent: [
"error",
2,
{
SwitchCase: 1,
},
],

"no-console": "off",
"no-var": "error",
"no-trailing-spaces": "error",
"prefer-const": "error",

quotes: [
"error",
"double",
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],

semi: ["error", "always"],
},
},
];
10 changes: 9 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
/* eslint-disable quotes */

"use strict";
/*
* Created with @iobroker/create-adapter v1.12.1
Expand Down Expand Up @@ -222,6 +222,7 @@ class Mercedesme extends utils.Adapter {

callback();
} catch (e) {
this.log.error("Error onUnload: " + e);
callback();
}
}
Expand Down Expand Up @@ -466,6 +467,7 @@ class Mercedesme extends utils.Adapter {
try {
currenJsonHistory = JSON.parse(currenJsonHistoryState.val);
} catch (error) {
this.log.debug("Error parsing json " + error);
currenJsonHistory = [];
}
}
Expand Down Expand Up @@ -511,6 +513,7 @@ class Mercedesme extends utils.Adapter {
});
}
async getGasPrice(vin) {
// eslint-disable-next-line
return new Promise(async (resolve) => {
const pre = this.name + "." + this.instance;

Expand Down Expand Up @@ -556,6 +559,8 @@ class Mercedesme extends utils.Adapter {
}
this.log.debug(tankk.stations[0].price);
resolve(tankk.stations[0].price);

// eslint-disable-next-line
} catch (error) {
resolve(0);
}
Expand Down Expand Up @@ -1245,6 +1250,7 @@ class Mercedesme extends utils.Adapter {
isJsonString(str) {
try {
JSON.parse(str);
// eslint-disable-next-line
} catch (e) {
return false;
}
Expand Down Expand Up @@ -1341,6 +1347,7 @@ class Mercedesme extends utils.Adapter {
});
}
login() {
// eslint-disable-next-line
return new Promise(async (resolve, reject) => {
this.log.debug("Login");

Expand All @@ -1355,6 +1362,7 @@ class Mercedesme extends utils.Adapter {
if (error) {
this.log.error("Connection error no login possible. Relogin in 5min");
this.reLoginTimeout = setTimeout(() => {
this.log.info("Start initial loading");
this.initLoading();
}, 5 * 60 * 1000);
reject();
Expand Down
Loading

0 comments on commit 57c9e61

Please sign in to comment.