-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix weatheralerts: "Special Weather" Alert Type Not Found #217
Conversation
Hey, thanks for this PR! There is something wrong with the new line characters in this PR. I've added |
I converted the file to LF and git fixed it automatically apparently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks for this PR! It indeed seems to fix this problem! Can you also fix alert level check likewise?
MeteoalarmCard/src/integrations/weatheralerts.ts
Lines 118 to 120 in 32d5d79
if(!alertLevel) { | |
throw Error(`Unknown weatheralerts alert level: ${fullAlertName}`); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Fixes: #206
In the original code, the
!alertType
condition was used to check for a missing alert type. However, it had the unintended effect of returningtrue
for alert types with a value of 0. This was problematic because 0 was used for "Special Weather" and "Special Marine".The modified code uses
alertType === undefined
to explicitly check for a missing alert type while preserving the expected behavior for other valid numbered values.