Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Hombach authored and Hombach committed Dec 25, 2024
1 parent d716a0e commit ba75925
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 19 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ If you enjoyed this project — or just feeling generous, consider buying me a b

## Changelog

### 0.4.7 (2024-12-xx)
### 1.0.0 (2024-12-25)

- (hombach) set version to 1.0 for stable release
- (hombach) add newVersionStatus (#80)
- (hombach) add configurable poll timeout

### 0.4.6 (2024-12-21)

Expand Down
3 changes: 2 additions & 1 deletion admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Token für die TeslaFi-API",
"LBL_UpdateInterval": "Aktualisierungsintervall in Sekunden",
"LBL_helpLink": "Adapterdokumentation anzeigen",
"TXT_donateTx": "Wenn Ihnen dieses Projekt gefallen hat – oder Sie sich einfach großzügig fühlen, denken Sie darüber nach, mir ein Bier zu spendieren. Prost! 🍻"
"TXT_donateTx": "Wenn Ihnen dieses Projekt gefallen hat – oder Sie sich einfach großzügig fühlen, denken Sie darüber nach, mir ein Bier zu spendieren. Prost! 🍻",
"LBL_UpdateTimeout": "Update-Timeout in Millisekunden"
}
1 change: 1 addition & 0 deletions admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"LBL_StandardTab": "Standard Settings",
"LBL_TeslaFiAPIToken": "Token for TeslaFi API",
"LBL_UpdateInterval": "Update interval in seconds",
"LBL_UpdateTimeout": "Update timeout in milliseconds",
"LBL_helpLink": "Show adapter documentation",
"TXT_donateTx": "If you enjoyed this project — or just feeling generous, consider buying me a beer. Cheers! 🍻"
}
3 changes: 2 additions & 1 deletion admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Token para la API de TeslaFi",
"LBL_UpdateInterval": "Intervalo de actualización en segundos",
"LBL_helpLink": "Mostrar documentación del adaptador",
"TXT_donateTx": "Si disfrutó este proyecto, o simplemente se siente generoso, considere invitarme a una cerveza. ¡Salud! 🍻"
"TXT_donateTx": "Si disfrutó este proyecto, o simplemente se siente generoso, considere invitarme a una cerveza. ¡Salud! 🍻",
"LBL_UpdateTimeout": "Tiempo de espera de actualización en milisegundos"
}
3 changes: 2 additions & 1 deletion admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Jeton pour l'API TeslaFi",
"LBL_UpdateInterval": "Intervalle de mise à jour en secondes",
"LBL_helpLink": "Afficher la documentation de l'adaptateur",
"TXT_donateTx": "Si vous avez apprécié ce projet – ou si vous vous sentez simplement généreux, pensez à m'acheter une bière. Acclamations! 🍻"
"TXT_donateTx": "Si vous avez apprécié ce projet – ou si vous vous sentez simplement généreux, pensez à m'acheter une bière. Acclamations! 🍻",
"LBL_UpdateTimeout": "Délai d'expiration de la mise à jour en millisecondes"
}
3 changes: 2 additions & 1 deletion admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Token per l'API TeslaFi",
"LBL_UpdateInterval": "Intervallo di aggiornamento in secondi",
"LBL_helpLink": "Mostra la documentazione dell'adattatore",
"TXT_donateTx": "Se ti è piaciuto questo progetto o semplicemente ti senti generoso, valuta l'idea di comprarmi una birra. Saluti! 🍻"
"TXT_donateTx": "Se ti è piaciuto questo progetto o semplicemente ti senti generoso, valuta l'idea di comprarmi una birra. Saluti! 🍻",
"LBL_UpdateTimeout": "Timeout aggiornamento in millisecondi"
}
3 changes: 2 additions & 1 deletion admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Token voor TeslaFi-API",
"LBL_UpdateInterval": "Update-interval in seconden",
"LBL_helpLink": "Adapterdocumentatie tonen",
"TXT_donateTx": "Als je van dit project hebt genoten – of je gewoon vrijgevig bent, overweeg dan om een ​​biertje voor me te kopen. Proost! 🍻"
"TXT_donateTx": "Als je van dit project hebt genoten – of je gewoon vrijgevig bent, overweeg dan om een ​​biertje voor me te kopen. Proost! 🍻",
"LBL_UpdateTimeout": "Updatetime-out in milliseconden"
}
3 changes: 2 additions & 1 deletion admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Token dla API TeslaFi",
"LBL_UpdateInterval": "Interwał aktualizacji w sekundach",
"LBL_helpLink": "Pokaż dokumentację adaptera",
"TXT_donateTx": "Jeśli spodobał Ci się ten projekt — lub po prostu czujesz się hojny, rozważ kupienie mi piwa. Dzięki! 🍻"
"TXT_donateTx": "Jeśli spodobał Ci się ten projekt — lub po prostu czujesz się hojny, rozważ kupienie mi piwa. Dzięki! 🍻",
"LBL_UpdateTimeout": "Limit czasu aktualizacji w milisekundach"
}
3 changes: 2 additions & 1 deletion admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Token para API TeslaFi",
"LBL_UpdateInterval": "Intervalo de atualização em segundos",
"LBL_helpLink": "Mostrar documentação do adaptador",
"TXT_donateTx": "Se você gostou deste projeto - ou apenas se sente generoso, considere comprar uma cerveja para mim. Saúde! 🍻"
"TXT_donateTx": "Se você gostou deste projeto - ou apenas se sente generoso, considere comprar uma cerveja para mim. Saúde! 🍻",
"LBL_UpdateTimeout": "Tempo limite de atualização em milissegundos"
}
3 changes: 2 additions & 1 deletion admin/i18n/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Токен для TeslaFi API",
"LBL_UpdateInterval": "Интервал обновления в секундах",
"LBL_helpLink": "Показать документацию по адаптеру",
"TXT_donateTx": "Если вам понравился этот проект или вы просто чувствуете щедрость, подумайте о том, чтобы купить мне пива. Ваше здоровье! 🍻"
"TXT_donateTx": "Если вам понравился этот проект или вы просто чувствуете щедрость, подумайте о том, чтобы купить мне пива. Ваше здоровье! 🍻",
"LBL_UpdateTimeout": "Тайм-аут обновления в миллисекундах"
}
3 changes: 2 additions & 1 deletion admin/i18n/uk/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "Токен для TeslaFi API",
"LBL_UpdateInterval": "Інтервал оновлення в секундах",
"LBL_helpLink": "Показати документацію адаптера",
"TXT_donateTx": "Якщо вам сподобався цей проект — або ви просто відчуваєте щедрість, купіть мені пива. здоров'я! 🍻"
"TXT_donateTx": "Якщо вам сподобався цей проект — або ви просто відчуваєте щедрість, купіть мені пива. здоров'я! 🍻",
"LBL_UpdateTimeout": "Час очікування оновлення в мілісекундах"
}
3 changes: 2 additions & 1 deletion admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"LBL_TeslaFiAPIToken": "TeslaFi API 的令牌",
"LBL_UpdateInterval": "更新间隔(秒)",
"LBL_helpLink": "显示适配器文档",
"TXT_donateTx": "如果你喜欢这个项目——或者只是觉得慷慨,可以考虑给我买瓶啤酒。干杯! 🍻"
"TXT_donateTx": "如果你喜欢这个项目——或者只是觉得慷慨,可以考虑给我买瓶啤酒。干杯! 🍻",
"LBL_UpdateTimeout": "更新超时(以毫秒为单位)"
}
14 changes: 14 additions & 0 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
"xl": 6,
"newLine": true
},
"UpdateTimeout": {
"type": "number",
"label": "LBL_UpdateTimeout",
"hidden": "!data.TeslaFiAPIToken",
"min": 1000,
"max": 30000,
"step": 100,
"default": 5000,
"xs": 12,
"sm": 12,
"md": 10,
"lg": 8,
"xl": 6
},

"_headerDocumentation": {
"type": "header",
Expand Down
3 changes: 2 additions & 1 deletion build/lib/teslafiAPICaller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/lib/teslafiAPICaller.js.map

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"common": {
"name": "teslafi",
"version": "0.4.7",
"version": "1.0.0",
"news": {
"0.4.7": {
"en": "add newVersionStatus (#80)"
"1.0.0": {
"en": "version bumped to 1.0 for stable release\nadd newVersionStatus (#80)\nadd configurable poll timeout",
"de": "Version wurde für eine stabile Veröffentlichung auf 1.0 erhöht\nnewVersionStatus hinzufügen (#80)\nFügen Sie ein konfigurierbares Poll-Timeout hinzu",
"ru": "версия увеличена до 1.0 для стабильной версии\nдобавить новыйVersionStatus (#80)\nдобавить настраиваемый тайм-аут опроса",
"pt": "versão passou para 1.0 para versão estável\nadicione newVersionStatus (#80)\nadicionar tempo limite de pesquisa configurável",
"nl": "versie verhoogd naar 1.0 voor stabiele release\nnieuweVersionStatus toevoegen (#80)\nconfigureerbare poll-time-out toevoegen",
"fr": "version passée à 1.0 pour une version stable\najouter newVersionStatus (#80)\najouter un délai d'attente d'interrogation configurable",
"it": "versione aumentata alla 1.0 per il rilascio stabile\naggiungi nuovo stato versione (#80)\naggiungere timeout del sondaggio configurabile",
"es": "La versión aumentó a 1.0 para una versión estable.\nagregar nuevo estado de versión (#80)\nagregar tiempo de espera de encuesta configurable",
"pl": "wersja została zmieniona na 1.0 w celu uzyskania stabilnego wydania\ndodaj nowyStatus wersji (#80)\ndodaj konfigurowalny limit czasu ankiety",
"uk": "версія підвищена до 1.0 для стабільного випуску\nдодати newVersionStatus (#80)\nдодати настроюваний тайм-аут опитування",
"zh-cn": "版本已升至 1.0 以进行稳定发布\n添加新版本状态 (#80)\n添加可配置的轮询超时"
},
"0.4.6": {
"en": "fix chai\noptimize documentation",
Expand Down Expand Up @@ -155,7 +165,8 @@
"protectedNative": ["TeslaFiAPIToken", "teslafiapitokenpass"],
"native": {
"TeslaFiAPIToken": "",
"UpdateInterval": "60"
"UpdateInterval": "60",
"UpdateTimeout": 5000
},
"objects": [],
"instanceObjects": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.teslafi",
"version": "0.4.7",
"version": "1.0.0",
"description": "Adapter to poll TeslaFi data of your car",
"author": {
"name": "Hombach",
Expand Down
1 change: 1 addition & 0 deletions src/lib/adapter-config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare global {
interface AdapterConfig {
TeslaFiAPIToken: string;
UpdateInterval: number;
UpdateTimeout: number;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/lib/teslafiAPICaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { add, format, fromUnixTime } from "date-fns";
import { ProjectUtils } from "./projectUtils";

const axiosInstance = axios.create({
timeout: 5000, // Standard-Timeout von 5 Sekunden
//timeout: 5000, //by default
});

interface VehicleData {
Expand Down Expand Up @@ -212,6 +212,7 @@ function calculateEndTimeFromNow(hours: number, dateFormat = "dd.MM.yyyy HH:mm:s
*/
export class TeslaFiAPICaller extends ProjectUtils {
queryUrl = "";

/**
* constructor
*
Expand All @@ -229,6 +230,7 @@ export class TeslaFiAPICaller extends ProjectUtils {
try {
const response = await axiosInstance.get(`${this.queryUrl}${this.adapter.config.TeslaFiAPIToken}&command=`, {
transformResponse: r => r,
timeout: this.adapter.config.UpdateTimeout, // 5000 by default
});

if (!response.data) {
Expand Down

0 comments on commit ba75925

Please sign in to comment.