From be4628bf0d70650091e3bf6cb45ec254bbc311fa Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 27 Mar 2023 06:42:05 +0200 Subject: [PATCH] var --- README.md | 3 +++ io-package.json | 15 ++++++++++++++- main.js | 28 +++++++++++++++++++++++----- package.json | 2 +- 4 files changed, 41 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3794df2..b1125e6 100755 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ Choose your country, and afterwards the region you want the warnings for. If you ## Changelog +## 2.3.5 (2023-03-27) +* (jack-blackson) IOBROKER-METEOALARM-47 & IOBROKER-METEOALARM-48 + ## 2.3.4 (2023-03-26) * (jack-blackson) IOBROKER-METEOALARM-4A diff --git a/io-package.json b/io-package.json index c9e4f93..7975d48 100755 --- a/io-package.json +++ b/io-package.json @@ -1,8 +1,21 @@ { "common": { "name": "meteoalarm", - "version": "2.3.4", + "version": "2.3.5", "news": { + "2.3.5": { + "en": "Bugfix", + "de": "Fehlerbehebung", + "ru": "Исправление ошибок", + "pt": "Correções de bugs", + "nl": "Bugfixes", + "fr": "Corrections de bugs", + "it": "Correzioni di bug", + "es": "Corrección de errores", + "pl": "Poprawki", + "zh-cn": "Bug修复", + "uk": "Виправлення помилок" + }, "2.3.4": { "en": "Bugfix", "de": "Fehlerbehebung", diff --git a/main.js b/main.js index 4977341..480e7e6 100755 --- a/main.js +++ b/main.js @@ -286,7 +286,9 @@ async function getData(){ const csv = await getCSVData() const temp = await adapter.getStateAsync('noOfAlarms') - noOfAlarmsAtStart = temp.val + if (temp){ + noOfAlarmsAtStart = temp.val + } adapter.log.debug('0: Existing alarm objects at adapter start: ' + noOfAlarmsAtStart) const temp2 = await saveAlarmNamesForLater() @@ -731,6 +733,10 @@ function checkRelevante(entry){ } var eventType = element['cap:event'] + + if (locationRelevant){ + adapter.log.debug('4.1.2: Check Result: dateRelevant = ' + dateRelevant + "statusrelevant= " + statusRelevant + " messagetyperelevant = " + messagetypeRelevant ) + } if (locationRelevant && (dateRelevant) && statusRelevant && messagetypeRelevant){ for(var i = 0; i < element.link.length; i += 1) { @@ -905,7 +911,10 @@ async function saveAlarmNamesForLater(){ async function saveAlarmsForLater(alarmName){ let path = 'alarms.' + alarmName - const effective = await adapter.getStateAsync(path + '.effective') + var effective = await adapter.getStateAsync(path + '.effective') + if (effective == null){ + effective = "" + } var referenz = await adapter.getStateAsync(path + '.updateIdentifier') if (referenz == null){ referenz = "" @@ -914,9 +923,18 @@ async function saveAlarmsForLater(alarmName){ if (sent == null){ sent = "" } - const expires = await adapter.getStateAsync(path + '.expires') - const tempLevel = await adapter.getStateAsync(path + '.effective') - const type = await adapter.getStateAsync(path + '.type') + var expires = await adapter.getStateAsync(path + '.expires') + if (expires == null){ + expires = "" + } + var tempLevel = await adapter.getStateAsync(path + '.level') + if (tempLevel == null){ + tempLevel = "" + } + var type = await adapter.getStateAsync(path + '.type') + if (type == null){ + type = "" + } alarmOldArray.push( { Alarm_Identifier: alarmName, diff --git a/package.json b/package.json index 984d94e..45d324a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.meteoalarm", - "version": "2.3.4", + "version": "2.3.5", "description": "Meteolaram", "main": "main.js", "repository": {