Closed mbomb007 closed 4 weeks ago
It might be a NWS issue but will ping @alexander0042 to look into this and get back to you.
I took a look at the API for the location you edited out and I can see the issue and is likely what you mentioned so should be an easy fix. The regions still have a leading space and needs to be fixed which should just be the case of adding .strip()
to the line where the region list is being split.
Looks like this one got missed from last week. Will try to ping @alexander0042 again to see if he can look into this.
When testing this issue I noticed that the alert description has no line breaks. When the description is shown on a page everything is in one text block which can be hard to read through.
Yes, I just added line breaks with
// Put in line breaks for readability.
$description = str_replace(
['* ', ' ...'],
['<br><br>* ', '<br><br> ...'],
$description
);
// Remove leading breaks that occur if there is no leading text.
$description = preg_replace('/^(?:<br>)+/', '', $description);
But line breaks would be helpful.
Sorry that I missed this- you're spot on about the onset time, I just grabbed the wrong variable there, so that's been corrected.
The line breaks were actually an intentional decision, Dark Sky didn't return line breaks (See: Issue 38 from the HA repo, so I wanted to keep it consistent with that. However, I see why it's a pain to not have them, and agree it would be better if they were there! You should see them live shortly, and I'll keep an eye out to see if it breaks anything
Describe the bug
This is likely an upstream problem with the NWS, but I have an alert where the start time comes after the expiration time.
Expected behavior
An alert's start time comes before the time it expires.
Actual behavior
The API is using the
<onset>
property for the start time, rather than the<effective>
property, which is probably what it should use.This is the data from the NWS Alert .cap file:
API Endpoint
Production
Other details
https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.909ae5ab6113a0467ac3b38120588e2c04187ad6.001.3.cap
Troubleshooting steps