WSDOT / wsdot-kotlin-app

Source Code for the WSDOT Android Application
GNU General Public License v3.0
1 stars 3 forks source link

Hood Canal Bridge Openings - Notifications not working #119

Closed waynedyck closed 3 years ago

waynedyck commented 3 years ago

I am receiving notifications on my Pixel 3a since signing up.

waynedyck commented 3 years ago

Identified what I believe the issue is. Certain statewide traffic alerts do not contain any latitude and longitude information. e.g. "Silver Alerts"

{
StartTime: "/Date(1625599560000-0700)/",
ExtendedDescription: "",
StartRoadwayLocation: {
Latitude: 0,
RoadName: null,
Description: null,
Direction: null,
MilePost: 0,
Longitude: 0
},
Region: "Northwest",
EndTime: null,
EventStatus: "Open",
EventCategory: "Silver Alert",
AlertID: 459954,
County: null,
LastUpdatedTime: "/Date(1625603171743-0700)/",
Priority: "Highest",
HeadlineDescription: "This is an activation of the Washington State-wide Silver Alert Plan in response to the report of a missing person. The WA State Patrol is asking for public's assistance in locating the following vehicle, a 2013 White Ford F-150 with WA lic# C25946B. If seen, please call 911.",
EndRoadwayLocation: {
Latitude: 0,
RoadName: null,
Description: null,
Direction: null,
MilePost: 0,
Longitude: 0
}
},

Notification script needs to be modified to ignore alerts with no latitude and longitude information.

waynedyck commented 3 years ago

Removed temporary fix for filtering known alerts without latitude and longitude information e.g. amber alerts, silver alerts and missing person alerts. Now filtering alerts if either latitude or longitude equal 0.

+        # Ignore statewide informational, non-location specific alerts
+        # e.g. amber alerts, silver alerts and missing person alerts
+        if (alert['StartRoadwayLocation']['Latitude'] == 0 or alert['StartRoadwayLocation']['Longitude'] == 0):
+            write_log("Ignore: " + str(alert['AlertID']) + " EventCategory: " + alert['EventCategory'])
             continue
waynedyck commented 3 years ago

Modifications appear to be working. Will continue to monitor.