Skip to content

Commit

Permalink
feat: add state type to long term statistics (RomRider#329)
Browse files Browse the repository at this point in the history
* Add statistics type state

* Updated documentation with new statistics type state
  • Loading branch information
Wesley-Vos committed Apr 22, 2022
1 parent 43aae7f commit 3fad4f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ series:

| Name | Type | Default | Since | Description |
| ---- | :--: | :-----: | :---: | ----------- |
| `type` | string | `mean` | NEXT_VERSION | Type of long term statistic to pull. Can be one of `min`, `max`, `mean` or `sum` |
| `type` | string | `mean` | NEXT_VERSION | Type of long term statistic to pull. Can be one of `min`, `max`, `mean`, `sum` or `state` |
| `period` | string | `hour` | NEXT_VERSION | Period of statistics to pull. Can be one of `5minute`, `hour`, `day` or `month` |
| `align` | string | `middle` | NEXT_VERSION | Align the data points to the `start`, `end` or `middle` of the period of the statistics |

Expand Down
2 changes: 1 addition & 1 deletion src/types-config-ti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const ChartCardAllSeriesExternalConfig = t.iface([], {
"invert": t.opt("boolean"),
"data_generator": t.opt("string"),
"statistics": t.opt(t.iface([], {
"type": t.opt(t.union(t.lit('mean'), t.lit('max'), t.lit('min'), t.lit('sum'))),
"type": t.opt(t.union(t.lit('mean'), t.lit('max'), t.lit('min'), t.lit('sum'), t.lit('state'))),
"period": t.opt("StatisticsPeriod"),
"align": t.opt(t.union(t.lit('start'), t.lit('end'), t.lit('middle'))),
})),
Expand Down
2 changes: 1 addition & 1 deletion src/types-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export interface ChartCardAllSeriesExternalConfig {
invert?: boolean;
data_generator?: string;
statistics?: {
type?: 'mean' | 'max' | 'min' | 'sum';
type?: 'mean' | 'max' | 'min' | 'sum' | 'state';
period?: StatisticsPeriod;
align?: 'start' | 'end' | 'middle';
};
Expand Down

0 comments on commit 3fad4f0

Please sign in to comment.