mirror of
https://github.com/home-assistant/core.git
synced 2026-09-28 02:18:10 -04:00
Add product calculation to Group sensor (#87373)
* Group product * config flow
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user