Do async_setup_platform in background (#36244)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Paulus SchoutsenandJ. Nick Koston authored and GitHub committed 2020-05-31 22:18:30 -07:00
1 parent d488c779fc
commit 276f3afb00
161 files changed
+1184 -305

No files matched your search

+15
View File
@@ -156,6 +156,7 @@ async def test_fail_setup_if_no_command_topic(hass, mqtt_mock):
light.DOMAIN,
{light.DOMAIN: {"platform": "mqtt", "schema": "json", "name": "test"}},
)
await hass.async_block_till_done()
assert hass.states.get("light.test") is None
@@ -174,6 +175,7 @@ async def test_no_color_brightness_color_temp_white_val_if_no_topics(hass, mqtt_
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -222,6 +224,7 @@ async def test_controlling_state_via_topic(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -346,6 +349,7 @@ async def test_sending_mqtt_commands_and_optimistic(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_ON
@@ -457,6 +461,7 @@ async def test_sending_hs_color(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -519,6 +524,7 @@ async def test_sending_rgb_color_no_brightness(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -572,6 +578,7 @@ async def test_sending_rgb_color_with_brightness(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -641,6 +648,7 @@ async def test_sending_rgb_color_with_scaled_brightness(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -709,6 +717,7 @@ async def test_sending_xy_color(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -771,6 +780,7 @@ async def test_effect(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -830,6 +840,7 @@ async def test_flash_short_and_long(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -869,6 +880,7 @@ async def test_transition(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -916,6 +928,7 @@ async def test_brightness_scale(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -959,6 +972,7 @@ async def test_invalid_values(hass, mqtt_mock):
}
},
)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.state == STATE_OFF
@@ -1235,6 +1249,7 @@ async def test_max_mireds(hass, mqtt_mock):
}
assert await async_setup_component(hass, light.DOMAIN, config)
await hass.async_block_till_done()
state = hass.states.get("light.test")
assert state.attributes.get("min_mireds") == 153