Skip to content

Commit

Permalink
New options in the adapter configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Homemade-Disaster committed Nov 6, 2023
1 parent 3894c71 commit fba3769
Show file tree
Hide file tree
Showing 18 changed files with 79 additions and 19 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Mittels der Netatmo-Energy API werden die aktuellen Einstellungen abgeholt bzw.

[Older changes](CHANGELOG_OLD.md)
<!-- ### **WORK IN PROGRESS** -->
### 2.6.5 (2023-11-05)

* (ioKlausi) New options in the adapter configuration for updating datapoints

### 2.6.4 (2023-10-25)

* (ioKlausi) Change value only if changes are detected
Expand Down
4 changes: 3 additions & 1 deletion admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Mehr Details",
"Set home mode": "Home-Modus einstellen",
"Enable / Disable sensor actions": "Sensoraktionen aktivieren / deaktivieren",
"Additional functions": "Zusätzliche Funktionen"
"Additional functions": "Zusätzliche Funktionen",
"Only update datapoints if changes are detected": "Nur Datenpunkte aktualisieren, wenn Änderungen erkannt werden",
"Change temperature states every time": "Temperaturzustände jedes Mal ändern"
}
4 changes: 3 additions & 1 deletion admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "More details",
"Set home mode": "Set home mode",
"Enable / Disable sensor actions": "Enable / Disable sensor actions",
"Additional functions": "Additional functions"
"Additional functions": "Additional functions",
"Only update datapoints if changes are detected": "Only update datapoints if changes are detected",
"Change temperature states every time": "Change temperature states every time"
}
4 changes: 3 additions & 1 deletion admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Más detalles",
"Set home mode": "Modo de inicio",
"Enable / Disable sensor actions": "Activar / Desactivar las acciones del sensor",
"Additional functions": "Funciones adicionales"
"Additional functions": "Funciones adicionales",
"Only update datapoints if changes are detected": "Sólo actualizar los puntos de datos si se detectan cambios",
"Change temperature states every time": "Cambiar los estados de temperatura cada vez"
}
4 changes: 3 additions & 1 deletion admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Plus de détails",
"Set home mode": "Mode home",
"Enable / Disable sensor actions": "Activer / Désactiver les actions du capteur",
"Additional functions": "Fonctions supplémentaires"
"Additional functions": "Fonctions supplémentaires",
"Only update datapoints if changes are detected": "Seulement mettre à jour les points de données si des changements sont détectés",
"Change temperature states every time": "La température change chaque fois"
}
4 changes: 3 additions & 1 deletion admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Maggiori dettagli",
"Set home mode": "Impostare la modalità home",
"Enable / Disable sensor actions": "Attiva / disattiva le azioni del sensore",
"Additional functions": "Funzioni aggiuntive"
"Additional functions": "Funzioni aggiuntive",
"Only update datapoints if changes are detected": "Aggiorna solo i datapoint se vengono rilevate le modifiche",
"Change temperature states every time": "Cambiare gli stati di temperatura ogni volta"
}
4 changes: 3 additions & 1 deletion admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Meer details",
"Set home mode": "Zet thuis modus",
"Enable / Disable sensor actions": "Enable/ Disable sensor acties",
"Additional functions": "Additionele functies"
"Additional functions": "Additionele functies",
"Only update datapoints if changes are detected": "Alleen updates als veranderingen worden ontdekt",
"Change temperature states every time": "Veranderde temperatuur staat elke keer"
}
4 changes: 3 additions & 1 deletion admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Szczegóły",
"Set home mode": "Tryb domowy",
"Enable / Disable sensor actions": "Wykorzystywanie czujników / urządzenie nieodpowiednich czujników",
"Additional functions": "Funkcja dodatkowa"
"Additional functions": "Funkcja dodatkowa",
"Only update datapoints if changes are detected": "Tylko aktualizacje danych jeśli zmiany są wykryte",
"Change temperature states every time": "Wartość zmian w temperaturze"
}
4 changes: 3 additions & 1 deletion admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Mais detalhes",
"Set home mode": "Definir modo de casa",
"Enable / Disable sensor actions": "Habilitar / Desativar ações do sensor",
"Additional functions": "Funções adicionais"
"Additional functions": "Funções adicionais",
"Only update datapoints if changes are detected": "Apenas atualize datapoints se as alterações forem detectadas",
"Change temperature states every time": "Alterar estados de temperatura sempre"
}
4 changes: 3 additions & 1 deletion admin/i18n/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Подробнее",
"Set home mode": "Установите домашний режим",
"Enable / Disable sensor actions": "Включить / Отключить действия датчика",
"Additional functions": "Дополнительные функции"
"Additional functions": "Дополнительные функции",
"Only update datapoints if changes are detected": "Только обновление данных точек, если изменения обнаружены",
"Change temperature states every time": "Изменить температуру каждый раз"
}
4 changes: 3 additions & 1 deletion admin/i18n/uk/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "Детальніше",
"Set home mode": "Налаштування домашнього режиму",
"Enable / Disable sensor actions": "Увімкнути / вимкнути дії датчика",
"Additional functions": "Додаткові функції"
"Additional functions": "Додаткові функції",
"Only update datapoints if changes are detected": "Виявлено лише оновлення точок даних, якщо виявлені зміни",
"Change temperature states every time": "Зміна температурних станів кожного разу"
}
4 changes: 3 additions & 1 deletion admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,7 @@
"More details": "详情",
"Set home mode": "建 议",
"Enable / Disable sensor actions": "易感染感情行动",
"Additional functions": "其他职能"
"Additional functions": "其他职能",
"Only update datapoints if changes are detected": "只有在发现变化时才更新数据点",
"Change temperature states every time": "变化温度"
}
19 changes: 19 additions & 0 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@
"newLine": true,
"type": "number",
"help": "Refresh states every x seconds"
},
"UpdateStatesIfChanged": {
"newLine": true,
"type": "checkbox",
"label": "Only update datapoints if changes are detected",
"default": true,
"sm": 12,
"md": 6,
"lg": 4
},
"UpdateStatesIfChangedTemp": {
"newLine": false,
"type": "checkbox",
"label": "Change temperature states every time",
"hidden": "data.UpdateStatesIfChanged !== true",
"default": false,
"sm": 12,
"md": 6,
"lg": 4
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions admin/words.js

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

15 changes: 14 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"common": {
"name": "netatmo-energy",
"version": "2.6.4",
"version": "2.6.5",
"news": {
"2.6.5": {
"en": "New options in the adapter configuration for updating datapoints",
"de": "Neue Optionen in der Adapterkonfiguration zur Aktualisierung von Datenpunkten",
"ru": "Новые опции в конфигурации адаптера для обновления данных точек",
"pt": "Novas opções na configuração do adaptador para atualizar datapoints",
"nl": "Nieuwe opties in de adapter configuratie voor het verminderen van gegevens",
"fr": "Nouvelles options dans la configuration de l'adaptateur pour la mise à jour des points de données",
"it": "Nuove opzioni nella configurazione dell'adattatore per l'aggiornamento dei datapoint",
"es": "Nuevas opciones en la configuración del adaptador para actualizar los puntos de datos",
"pl": "Nowe opcje w konfiguracji adapterowej dla updating datapoints",
"uk": "Нові параметри в конфігурації адаптера для оновлення точок даних",
"zh-cn": "更新数据点的适应组合的新选择"
},
"2.6.4": {
"en": "Change value only if changes are detected",
"de": "Nur ändern, wenn Änderungen erkannt werden",
Expand Down
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1263,8 +1263,8 @@ class NetatmoEnergy extends utils.Adapter {
await this.setObjectAsync(id, myObject);
if (!norefresh) {
const actvalue = await this.getStateAsync(id);
if (actvalue != null && actvalue.val != value) {
this.log.debug(mytools.tl('Event triggered:', this.systemLang) + glob.blank + id + ': ' + actvalue.val + ' --> ' + value);
if (this.config.UpdateStatesIfChanged == false || (this.config.UpdateStatesIfChanged == true && ((actvalue && actvalue != null && actvalue.val != value) || (this.config.UpdateStatesIfChangedTemp == true && role == 'value.temperature')))) {
this.log.debug(mytools.tl('Event triggered:', this.systemLang) + glob.blank + id + ': ' + ((actvalue) ? ' (' + actvalue.val + ')' : 'NULL') + ' --> ' + value);
await this._subscribeStates(id);
await this.setState(id, value, ack);
}
Expand All @@ -1274,8 +1274,8 @@ class NetatmoEnergy extends utils.Adapter {
await this.setObjectNotExistsAsync(id, myObject);
if (!norefresh) {
const actvalue = await this.getStateAsync(id);
if (actvalue != null && actvalue.val != value) {
this.log.debug(mytools.tl('Event triggered:', this.systemLang) + glob.blank + id + ': ' + actvalue.val + ' --> ' + value);
if (this.config.UpdateStatesIfChanged == false || (this.config.UpdateStatesIfChanged == true && ((actvalue && actvalue != null && actvalue.val != value) || (this.config.UpdateStatesIfChangedTemp == true && role == 'value.temperature')))) {
this.log.debug(mytools.tl('Event triggered:', this.systemLang) + glob.blank + id + ': ' + ((actvalue) ? ' (' + actvalue.val + ')' : 'NULL') + ' --> ' + value);
await this._subscribeStates(id);
await this.setState(id, value, ack);
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.netatmo-energy",
"version": "2.6.4",
"version": "2.6.5",
"engines": {
"node": ">=16.0.0"
},
Expand Down

0 comments on commit fba3769

Please sign in to comment.