Add additional characteristics to the statistics integration (#62631)
* Improve config checking, add device_class timestamp * Improve warning message
This commit is contained in:
parent
1df99badcf
commit
f2d6a06a6a
2 changed files with 90 additions and 2 deletions
|
@ -687,6 +687,22 @@ async def test_state_characteristics(hass: HomeAssistant):
|
|||
"value_9": (start_datetime + timedelta(minutes=1)).isoformat(),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "sensor",
|
||||
"name": "datetime_value_max",
|
||||
"value_0": STATE_UNKNOWN,
|
||||
"value_1": (start_datetime + timedelta(minutes=9)).isoformat(),
|
||||
"value_9": (start_datetime + timedelta(minutes=2)).isoformat(),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "sensor",
|
||||
"name": "datetime_value_min",
|
||||
"value_0": STATE_UNKNOWN,
|
||||
"value_1": (start_datetime + timedelta(minutes=9)).isoformat(),
|
||||
"value_9": (start_datetime + timedelta(minutes=5)).isoformat(),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "sensor",
|
||||
"name": "distance_95_percent_of_values",
|
||||
|
@ -811,6 +827,38 @@ async def test_state_characteristics(hass: HomeAssistant):
|
|||
"value_9": len(VALUES_BINARY),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "binary_sensor",
|
||||
"name": "count_on",
|
||||
"value_0": 0,
|
||||
"value_1": 1,
|
||||
"value_9": VALUES_BINARY.count("on"),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "binary_sensor",
|
||||
"name": "count_off",
|
||||
"value_0": 0,
|
||||
"value_1": 0,
|
||||
"value_9": VALUES_BINARY.count("off"),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "binary_sensor",
|
||||
"name": "datetime_newest",
|
||||
"value_0": STATE_UNKNOWN,
|
||||
"value_1": (start_datetime + timedelta(minutes=9)).isoformat(),
|
||||
"value_9": (start_datetime + timedelta(minutes=9)).isoformat(),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "binary_sensor",
|
||||
"name": "datetime_oldest",
|
||||
"value_0": STATE_UNKNOWN,
|
||||
"value_1": (start_datetime + timedelta(minutes=9)).isoformat(),
|
||||
"value_9": (start_datetime + timedelta(minutes=1)).isoformat(),
|
||||
"unit": None,
|
||||
},
|
||||
{
|
||||
"source_sensor_domain": "binary_sensor",
|
||||
"name": "mean",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue