Add product calculation to Group sensor (#87373)
* Group product * config flow
This commit is contained in:
parent
8b7594ae08
commit
706e8d5612
3 changed files with 18 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
"""The tests for the Group Sensor platform."""
|
||||
from __future__ import annotations
|
||||
|
||||
from math import prod
|
||||
import statistics
|
||||
from typing import Any
|
||||
from unittest.mock import patch
|
||||
|
@ -45,6 +46,7 @@ MEAN = statistics.mean(VALUES)
|
|||
MEDIAN = statistics.median(VALUES)
|
||||
RANGE = max(VALUES) - min(VALUES)
|
||||
SUM_VALUE = sum(VALUES)
|
||||
PRODUCT_VALUE = prod(VALUES)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
@ -57,6 +59,7 @@ SUM_VALUE = sum(VALUES)
|
|||
("last", VALUES[2], {ATTR_LAST_ENTITY_ID: "sensor.test_3"}),
|
||||
("range", RANGE, {}),
|
||||
("sum", SUM_VALUE, {}),
|
||||
("product", PRODUCT_VALUE, {}),
|
||||
],
|
||||
)
|
||||
async def test_sensors(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue