Skip to content

Commit 00a0fae

Browse files
authored
Improve numerical trigger and condition tests (home-assistant#172308)
1 parent 0c816c2 commit 00a0fae

2 files changed

Lines changed: 428 additions & 0 deletions

File tree

tests/helpers/test_condition.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,6 +3326,63 @@ async def async_get_conditions(
33263326
"90",
33273327
False,
33283328
),
3329+
# outside (inverse of between) — limits are non-inclusive, so a value
3330+
# equal to either bound is treated as "not inside" and matches
3331+
(
3332+
{
3333+
"threshold": {
3334+
"type": "outside",
3335+
"value_min": {"number": 20},
3336+
"value_max": {"number": 80},
3337+
}
3338+
},
3339+
"50",
3340+
False,
3341+
),
3342+
(
3343+
{
3344+
"threshold": {
3345+
"type": "outside",
3346+
"value_min": {"number": 20},
3347+
"value_max": {"number": 80},
3348+
}
3349+
},
3350+
"20",
3351+
True,
3352+
),
3353+
(
3354+
{
3355+
"threshold": {
3356+
"type": "outside",
3357+
"value_min": {"number": 20},
3358+
"value_max": {"number": 80},
3359+
}
3360+
},
3361+
"80",
3362+
True,
3363+
),
3364+
(
3365+
{
3366+
"threshold": {
3367+
"type": "outside",
3368+
"value_min": {"number": 20},
3369+
"value_max": {"number": 80},
3370+
}
3371+
},
3372+
"10",
3373+
True,
3374+
),
3375+
(
3376+
{
3377+
"threshold": {
3378+
"type": "outside",
3379+
"value_min": {"number": 20},
3380+
"value_max": {"number": 80},
3381+
}
3382+
},
3383+
"90",
3384+
True,
3385+
),
33293386
],
33303387
)
33313388
async def test_numerical_condition_thresholds(

0 commit comments

Comments
 (0)