Upgrade black to 20.8b1 (#39287)
This commit is contained in:
parent
0d7eec710c
commit
1c2ebdf307
574 changed files with 4389 additions and 1725 deletions
|
@ -600,50 +600,53 @@ async def test_extract_entities():
|
|||
|
||||
async def test_extract_devices():
|
||||
"""Test extracting devices."""
|
||||
assert condition.async_extract_devices(
|
||||
{
|
||||
"condition": "and",
|
||||
"conditions": [
|
||||
{"condition": "device", "device_id": "abcd", "domain": "light"},
|
||||
{"condition": "device", "device_id": "qwer", "domain": "switch"},
|
||||
{
|
||||
"condition": "state",
|
||||
"entity_id": "sensor.not_a_device",
|
||||
"state": "100",
|
||||
},
|
||||
{
|
||||
"condition": "not",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "abcd_not",
|
||||
"domain": "light",
|
||||
},
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "qwer_not",
|
||||
"domain": "switch",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
"condition": "or",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "abcd_or",
|
||||
"domain": "light",
|
||||
},
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "qwer_or",
|
||||
"domain": "switch",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
) == {"abcd", "qwer", "abcd_not", "qwer_not", "abcd_or", "qwer_or"}
|
||||
assert (
|
||||
condition.async_extract_devices(
|
||||
{
|
||||
"condition": "and",
|
||||
"conditions": [
|
||||
{"condition": "device", "device_id": "abcd", "domain": "light"},
|
||||
{"condition": "device", "device_id": "qwer", "domain": "switch"},
|
||||
{
|
||||
"condition": "state",
|
||||
"entity_id": "sensor.not_a_device",
|
||||
"state": "100",
|
||||
},
|
||||
{
|
||||
"condition": "not",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "abcd_not",
|
||||
"domain": "light",
|
||||
},
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "qwer_not",
|
||||
"domain": "switch",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
"condition": "or",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "abcd_or",
|
||||
"domain": "light",
|
||||
},
|
||||
{
|
||||
"condition": "device",
|
||||
"device_id": "qwer_or",
|
||||
"domain": "switch",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
== {"abcd", "qwer", "abcd_not", "qwer_not", "abcd_or", "qwer_or"}
|
||||
)
|
||||
|
||||
|
||||
async def test_condition_template_error(hass, caplog):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue