orontee/taranis

Hourly forecast should not be limited to 24 hours

orontee opened this issue · 4 comments

Context

On Friday evening or Saturday morning, I often organize the week-end cycling activities where hourly forecasts for Sunday matters. Openweather API offers hourly forecasts for 48 hours.

But the hourly forecast view of Taranis is currently limited to 24 hours. This limit is arbitrary: https://github.com/orontee/taranis/blob/v1.5.0-rc0/src/service.h#L48

Proposition

  • Increase the hourly forecast limit to 48 hours

Remarks

The number of "screens" of the hourly forecast view will increase from 3 to 6 (since the number of visible bars is hard-coded, equal to 8). As a consequence, the days of the displayed data may become more ambiguous than it already is. Thus one must display those days and a convenient way to switch to the daily forecast view.

  • Add a label to identify the day of the displayed data
  • Long press on previous or next key switch to daily forecast

Details on how to display the day

Add a top row to the daily forecast frame. This row may display two labels on its left and right ends. The left label will display the date of the day corresponding to the first bar and the right label will display the date of the day corresponding to the last bar. When both days are equal, the right label is hidden. Attempt is made to display "Today" or "Tomorrow" in place of dates.

Would it be possible to:

  • Double press skips between the start of the two 24 hour periods, today/tomorrow
  • Long press switches to Daily view

Would it be possible to:

  • Double press skips between the start of the two 24 hour periods, today/tomorrow

Good idea! But AFAICS the SDK doesn't provide any way to handle double press. So, I may try to implement this but in a second time and a dedicated issue since it may imply a rewrite of parts of the application and it's not required for the feature to be released.

  • Long press switches to Daily view

Another good idea 🤩 I saw there's a EVT_KEYREPEAT event that triggers when a key is pressed for long time; It should be easy to support this right now.

This hints at something to do with a double-press...

enum globalaction_on_event_e {
	GLOBALACTION_ON_KEYPRESS = 0, //masked by mpc->gka0
	GLOBALACTION_ON_KEYHOLD, //masked by mpc->gka1
	GLOBALACTION_ON_DOUBLECLICK, //masked by mpc->gka2
};

Available from https://github.com/orontee/taranis/releases/tag/v1.5.0-rc1

Translations will arrive later (after #61 is merged into main branch).