Add product calculation to Group sensor (#87373)

* Group product

* config flow
This commit is contained in:
G Johansson 2023-03-28 09:35:09 +02:00 committed by GitHub
parent 8b7594ae08
commit 706e8d5612
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View file

@ -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(