Skip to content

Commit 3fad4f0

Browse files
authored
feat: add state type to long term statistics (#329)
* Add statistics type state * Updated documentation with new statistics type state
1 parent 43aae7f commit 3fad4f0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ series:
267267

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

src/types-config-ti.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const ChartCardAllSeriesExternalConfig = t.iface([], {
7777
"invert": t.opt("boolean"),
7878
"data_generator": t.opt("string"),
7979
"statistics": t.opt(t.iface([], {
80-
"type": t.opt(t.union(t.lit('mean'), t.lit('max'), t.lit('min'), t.lit('sum'))),
80+
"type": t.opt(t.union(t.lit('mean'), t.lit('max'), t.lit('min'), t.lit('sum'), t.lit('state'))),
8181
"period": t.opt("StatisticsPeriod"),
8282
"align": t.opt(t.union(t.lit('start'), t.lit('end'), t.lit('middle'))),
8383
})),

src/types-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export interface ChartCardAllSeriesExternalConfig {
7777
invert?: boolean;
7878
data_generator?: string;
7979
statistics?: {
80-
type?: 'mean' | 'max' | 'min' | 'sum';
80+
type?: 'mean' | 'max' | 'min' | 'sum' | 'state';
8181
period?: StatisticsPeriod;
8282
align?: 'start' | 'end' | 'middle';
8383
};

0 commit comments

Comments
 (0)