energy-period-selector-plus icon indicating copy to clipboard operation
energy-period-selector-plus copied to clipboard

feat: Add support for rolling & default periods

Open madsciencetist opened this issue 1 year ago • 1 comments

I have energy dashboards for which energy-period-selector-plus selects the time period of the data. Before clicking any buttons, this time period always initialized to start from the beginning of the current day. Usage numbers would be highly variable and would depend on what time of day I happen to look at the dashboard.

My goal was to instead be able to initialize to seeing the past 24h of usage - or the past 7 days, or the past month. Always displaying the path month's worth of usage gives me a rolling view that is always more intuitive and still synchronizes with my utility bill once a month.

To enable this, I have added two new features:

  1. A toggle to interpret time periods as e.g. "the past month" instead of "the current month to date"
  2. The ability to set the default period to something other than Day.

I don't think I broke anything, but it's worth a close review.

madsciencetist avatar Jan 22 '24 22:01 madsciencetist