Open mboneil10 opened 6 years ago
They're two separate data points, right? The status of the bus and its EDT? Arguably we're just accurately reporting inconsistent data.
I'm not 100% sure, but I believe @akaplo found that the only two values ever reported were "Late" and "On Time". Indeed that is the case e.g. right now:
$ curl -s --header 'Accept: application/json' 'https://bustracker.pvta.com/InfoPoint/rest/Vehicles/GetAllVehicles' | jq '.[] | .DisplayStatus' | sort -u
"Late"
"On Time"
$ curl -s --header 'Accept: application/json' 'https://bustracker.pvta.com/InfoPoint/rest/Vehicles/GetAllVehicles' | jq '.[] | .Deviation' | sort -n
-5
-5
-4
-2
0
#...
0
1
#...
6
7
9
9
10
12
20
Ugh. At first I thought, "Oh, look! there's a field OpStatus
that sometimes contains the string "EARLY", perhaps that's a good source of information." Nope. Take a look at this grab-bag of :cow:
Right, a vehicle's DisplayStatus
is either On Time
or Late
. Unfortunately, best approach for our users is probably to check for a negative Deviation
, flip DisplayStatus
to whichever it isn't equal to, and strip out the negative. Ugh!
I think with this one @werebus, @sherson and I decided that it would be best to ask Avail if we can display "Early" or strip out the negative without any bad side effects.
In development mode, I ran into the following issue:
Should probably say "early" or "on time" next to the clock symbol. Not sure if this is also happening in production.