mirror of
https://github.com/home-assistant/core.git
synced 2026-09-27 18:08:37 -04:00
Adds MQTT Fan Discovery (#9463)
This commit is contained in:
committed by
Pascal Vizeli
parent
bda6d2c696
commit
8a3f8457e8
@@ -77,6 +77,23 @@ def test_correct_config_discovery(hass, mqtt_mock, caplog):
|
||||
assert ('binary_sensor', 'bla') in hass.data[ALREADY_DISCOVERED]
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_discover_fan(hass, mqtt_mock, caplog):
|
||||
"""Test discovering an MQTT fan."""
|
||||
yield from async_start(hass, 'homeassistant', {})
|
||||
|
||||
async_fire_mqtt_message(hass, 'homeassistant/fan/bla/config',
|
||||
('{ "name": "Beer",'
|
||||
' "command_topic": "test_topic" }'))
|
||||
yield from hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get('fan.beer')
|
||||
|
||||
assert state is not None
|
||||
assert state.name == 'Beer'
|
||||
assert ('fan', 'bla') in hass.data[ALREADY_DISCOVERED]
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_discovery_incl_nodeid(hass, mqtt_mock, caplog):
|
||||
"""Test sending in correct JSON with optional node_id included."""
|
||||
|
||||
Reference in New Issue
Block a user