OneBusAway / onebusaway-alexa

An Java-based app to communicate with Amazon Alexa for devices such as the Amazon Echo
Other
52 stars 18 forks source link

Group upcoming arrivals for the same route/headsign #70

Closed barbeau closed 7 years ago

barbeau commented 8 years ago

Summary:

From user beta testing (https://github.com/OneBusAway/onebusaway-alexa/issues/65):

When I did get Alexa to report my bus data, the result was not well-optimized for speech. There was one bus line that had four upcoming busses, and she repeated the name of the line with every arrival. It would have been a better experience if she had said something like “The next bus on Route 45 university district east green lake is arriving in 2 minutes. Route 45 will arrive again in 10 minutes, 18 minutes, and in 32 minutes based on the schedule."

We'll need to be careful that we can still distinguish between real-time and scheduled arrivals for the same route/headsign, and between arrival and departure information for the same route/headsign (see https://github.com/OneBusAway/onebusaway-client-library/issues/11 in library).

I've ticketed this issue in the library in https://github.com/OneBusAway/onebusaway-client-library/issues/12, as it would be best to provide the utility to do this in the library. We can close this issue after the functionality has been implemented in the library and integrated here.

Steps to reproduce:

Get arrival info for any stop.

Expected behavior:

All arrivals for the same route/headsign would be announced in a group:

Observed behavior:

Route/headsign are repeated for every arrival:

Device:

Amazon Echo

barbeau commented 8 years ago

I'm working on this via https://github.com/OneBusAway/onebusaway-client-library/issues/12.

barbeau commented 7 years ago

Alright, this is finally implemented in the onebusaway-client-library as a utility method that returns the summary as a string, with an optional separator (e.g., speech pause) between each group - UIUtils.getArrivalInfoSummary(List<ArrivalInfo> arrivalInfo, String separator)

See https://github.com/OneBusAway/onebusaway-client-library/pull/17 for details.

I'll work on integrating into OBA Alexa now.

barbeau commented 7 years ago

PR at https://github.com/OneBusAway/onebusaway-alexa/pull/98.