mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 13:00:11 +00:00
Upgrade black to 20.8b1 (#39287)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user