Move more MQTT platforms to config entries (#16918)
* Move more MQTT platforms to config entries * Address comments
This commit is contained in:
1 parent
720b05c301
commit
af89e7c50f
15 files changed
+214
-101
No files matched your search
@@ -3,7 +3,7 @@ import unittest
|
||||
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.setup import setup_component, async_setup_component
|
||||
import homeassistant.components.binary_sensor as binary_sensor
|
||||
from homeassistant.components import binary_sensor, mqtt
|
||||
from homeassistant.components.mqtt.discovery import async_start
|
||||
|
||||
from homeassistant.const import STATE_OFF, STATE_ON
|
||||
@@ -11,7 +11,8 @@ from homeassistant.const import EVENT_STATE_CHANGED, STATE_UNAVAILABLE
|
||||
|
||||
from tests.common import (
|
||||
get_test_home_assistant, fire_mqtt_message, async_fire_mqtt_message,
|
||||
mock_component, mock_mqtt_component, async_mock_mqtt_component)
|
||||
mock_component, mock_mqtt_component, async_mock_mqtt_component,
|
||||
MockConfigEntry)
|
||||
|
||||
|
||||
class TestSensorMQTT(unittest.TestCase):
|
||||
@@ -231,7 +232,8 @@ async def test_unique_id(hass):
|
||||
|
||||
async def test_discovery_removal_binary_sensor(hass, mqtt_mock, caplog):
|
||||
"""Test removal of discovered binary_sensor."""
|
||||
await async_start(hass, 'homeassistant', {})
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
await async_start(hass, 'homeassistant', {}, entry)
|
||||
data = (
|
||||
'{ "name": "Beer",'
|
||||
' "status_topic": "test_topic" }'
|
||||
|
||||
Reference in new issue
Block a user