nucleus-ffm / foss_warn

An unofficial open source application to get emergency alerts from https://warnung.bund.de/meldungen.
GNU General Public License v3.0
99 stars 6 forks source link

There are two Warnstufen: "Extrem" in notifications. #45

Closed citizenserious closed 2 years ago

citizenserious commented 2 years ago

Today because of the weather, DWD issued the Warnstufe Extrem for there first time since I use this app. Oddly enough I heard my default notification sound. When I looked into the settings there appeared a second Warnstufe: Extrem with default settings. Wasn't there before the notification got triggered.

FOSS Warn

nucleus-ffm commented 2 years ago

mh this is strange. FOSS Warn translates the severity and uses that as the notification channel here:

https://github.com/nucleus-ffm/foss_warn/blob/15dd62af8255a0d79433d8fe33d0042c06d6c51e/lib/class/class_NotificationService.dart#L15 and here: https://github.com/nucleus-ffm/foss_warn/blob/15dd62af8255a0d79433d8fe33d0042c06d6c51e/lib/services/helperFunctionToTranslateAndChooseColorTyp.dart#L116

but both channels seem to have the same name. So maybe one has one more space. But I can't check that because the warning is no longer online.

mainrs commented 2 years ago

You can, for good measure, just trim the string beforehand so this does not happen again. At least I can't think of any downsides this would have.

nucleus-ffm commented 2 years ago

the string is now simply trimmed. Hopefully this solves the problem. https://github.com/nucleus-ffm/foss_warn/blob/970730e2106caab9fd17cae35b91dd8032e4df47/lib/services/helperFunctionToTranslateAndChooseColorTyp.dart#L113

citizenserious commented 1 year ago

The problem appeared again, or still exists. I got two notifications with the same name for each warning level, except the "Warnstufe: hinweise" (maybe because it was not triggered yet). The second one appears the first time when there is a warning triggered and then stays and is used by Foss Warn.

v0.4.6