Skip to content

Commit

Permalink
chore: release v3.0.28
Browse files Browse the repository at this point in the history
improve creation of ALARM dps even if no states provided by `getDatapoints` (fixes #168)
  • Loading branch information
foxriver76 committed Jun 30, 2021
1 parent 3dab85a commit a638b4e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ with the ioBroker CLI. You can change the port via `iob set hm-rega.<instance> -
### __WORK IN PROGRESS__
-->

### 3.0.28 (2021-06-30)
* (foxriver76) improve creation of ALARM dps even if no states provided by `getDatapoints` (fixes #168)

### 3.0.27 (2021-06-28)
* (foxriver76) fixed a bug that already deleted programs were only partially deleted in ioBroker
__Please note: This will only work for deleted programs up from now. You have to clean up orphan programs manually__
Expand Down
14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "hm-rega",
"version": "3.0.27",
"version": "3.0.28",
"news": {
"3.0.28": {
"en": "improve creation of ALARM dps even if no states provided by `getDatapoints` (fixes #168)",
"de": "Verbessern Sie die Erstellung von ALARM dps, auch wenn keine Zustände von `getDatapoints` bereitgestellt werden (fixes #168)",
"ru": "улучшить создание ALARM dps, даже если нет состояний, предоставленных `getDatapoints` (исправления # 168)",
"pt": "melhorar a criação de ALARM dps mesmo se nenhum estado for fornecido por `getDatapoints` (correções # 168)",
"nl": "het maken van ALARM dps verbeteren, zelfs als er geen statussen zijn geleverd door 'getDatapoints' (fixes #168)",
"fr": "améliorer la création d'ALARM dps même si aucun état n'est fourni par `getDatapoints` (correctifs #168)",
"it": "migliorare la creazione di ALARM dps anche se nessuno stato fornito da `getDatapoints` (correzioni #168)",
"es": "mejorar la creación de ALARM dps incluso si no hay estados proporcionados por `getDatapoints` (arreglos # 168)",
"pl": "poprawić tworzenie ALARM dps, nawet jeśli nie ma stanów dostarczonych przez `getDatapoints` (poprawki #168)",
"zh-cn": "即使`getDatapoints` 没有提供状态,也会改进 ALARM dps 的创建(修复 #168)"
},
"3.0.27": {
"en": "* fixed a bug that already deleted programs were only partially deleted in ioBroker\n__Please note: This will only work for deleted programs up from now. You have to clean up orphan programs manually__",
"de": "* Fehler behoben, bei dem bereits gelöschte Programme in ioBroker nur teilweise gelöscht wurden\n__Bitte beachten Sie: Dies funktioniert ab jetzt nur noch für gelöschte Programme. Sie müssen verwaiste Programme manuell bereinigen__",
Expand Down
13 changes: 12 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,16 @@ function acknowledgeAlarm(id) {
*/
async function getServiceMsgs() {

let existingDevices = [];

try {
const res = await adapter.getObjectViewAsync('system', 'device',
{startkey: 'hm.rpc.', endkey: 'hm-rpc.\u9999'});
existingDevices = res.rows.map(obj => obj.id);
} catch (e) {
adapter.log.error(`Could not determine existing devices: ${e.message}`);
}

adapter.log.debug('create service messages');

let data = await rega.runScriptFile('alarms');
Expand All @@ -728,9 +738,10 @@ async function getServiceMsgs() {
let instanceNumber;

try {
instanceNumber = Object.keys(states).find(value => id.split(':')[0] === value.split('.')[2]).split('.')[1];
instanceNumber = existingDevices.find(value => id.split(':')[0] === value.split('.')[2]).split('.')[1];
} catch {
// instance not found -> "split" raises
adapter.log.debug(`No instance found for ${id}`);
continue;
} // endTryCatch

Expand Down
2 changes: 1 addition & 1 deletion 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.hm-rega",
"version": "3.0.27",
"version": "3.0.28",
"engines": {
"node": ">=10.0.0"
},
Expand Down

0 comments on commit a638b4e

Please sign in to comment.