Add standard deviation calculation to group (#112076)

* Add standard deviation calculation to group

* Add missing bits

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
This commit is contained in:
Bertrand Roussel 2024-05-10 01:16:09 -07:00 committed by GitHub
parent 8c54587d7e
commit 11f5b48724
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 8 deletions

View file

@ -48,6 +48,7 @@ MAX_VALUE = max(VALUES)
MEAN = statistics.mean(VALUES)
MEDIAN = statistics.median(VALUES)
RANGE = max(VALUES) - min(VALUES)
STDEV = statistics.stdev(VALUES)
SUM_VALUE = sum(VALUES)
PRODUCT_VALUE = prod(VALUES)
@ -61,6 +62,7 @@ PRODUCT_VALUE = prod(VALUES)
("median", MEDIAN, {}),
("last", VALUES[2], {ATTR_LAST_ENTITY_ID: "sensor.test_3"}),
("range", RANGE, {}),
("stdev", STDEV, {}),
("sum", SUM_VALUE, {}),
("product", PRODUCT_VALUE, {}),
],