Remove unused parameter for MQTT discovery (#36526)
* Remove unused parameter for MQTT discovery * Fix tests
This commit is contained in:
1 parent
823f27db5a
commit
35cd6b9abf
10 files changed
+74
-87
No files matched your search
@@ -251,7 +251,7 @@ async def help_test_discovery_update_attr(hass, mqtt_mock, caplog, domain, confi
|
||||
data2 = json.dumps(config2[domain])
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
async_fire_mqtt_message(hass, f"homeassistant/{domain}/bla/config", data1)
|
||||
await hass.async_block_till_done()
|
||||
async_fire_mqtt_message(hass, "attr-topic1", '{ "val": "100" }')
|
||||
@@ -287,7 +287,7 @@ async def help_test_discovery_removal(hass, mqtt_mock, caplog, domain, data):
|
||||
This is a test helper for the MqttDiscoveryUpdate mixin.
|
||||
"""
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
|
||||
async_fire_mqtt_message(hass, f"homeassistant/{domain}/bla/config", data)
|
||||
await hass.async_block_till_done()
|
||||
@@ -309,7 +309,7 @@ async def help_test_discovery_update(hass, mqtt_mock, caplog, domain, data1, dat
|
||||
This is a test helper for the MqttDiscoveryUpdate mixin.
|
||||
"""
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
|
||||
async_fire_mqtt_message(hass, f"homeassistant/{domain}/bla/config", data1)
|
||||
await hass.async_block_till_done()
|
||||
@@ -332,7 +332,7 @@ async def help_test_discovery_update(hass, mqtt_mock, caplog, domain, data1, dat
|
||||
async def help_test_discovery_broken(hass, mqtt_mock, caplog, domain, data1, data2):
|
||||
"""Test handling of bad discovery message."""
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
|
||||
async_fire_mqtt_message(hass, f"homeassistant/{domain}/bla/config", data1)
|
||||
await hass.async_block_till_done()
|
||||
@@ -362,7 +362,7 @@ async def help_test_entity_device_info_with_identifier(hass, mqtt_mock, domain,
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
data = json.dumps(config)
|
||||
@@ -390,7 +390,7 @@ async def help_test_entity_device_info_with_connection(hass, mqtt_mock, domain,
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
data = json.dumps(config)
|
||||
@@ -415,7 +415,7 @@ async def help_test_entity_device_info_remove(hass, mqtt_mock, domain, config):
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
dev_registry = await hass.helpers.device_registry.async_get_registry()
|
||||
ent_registry = await hass.helpers.entity_registry.async_get_registry()
|
||||
|
||||
@@ -447,7 +447,7 @@ async def help_test_entity_device_info_update(hass, mqtt_mock, domain, config):
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
data = json.dumps(config)
|
||||
@@ -521,7 +521,7 @@ async def help_test_entity_id_update_discovery_update(
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
ent_registry = mock_registry(hass, {})
|
||||
|
||||
data = json.dumps(config[domain])
|
||||
@@ -562,7 +562,7 @@ async def help_test_entity_debug_info(hass, mqtt_mock, domain, config):
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
data = json.dumps(config)
|
||||
@@ -598,7 +598,7 @@ async def help_test_entity_debug_info_max_messages(hass, mqtt_mock, domain, conf
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
data = json.dumps(config)
|
||||
@@ -663,7 +663,7 @@ async def help_test_entity_debug_info_message(
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
data = json.dumps(config)
|
||||
@@ -712,7 +712,7 @@ async def help_test_entity_debug_info_remove(hass, mqtt_mock, domain, config):
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
registry = await hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
data = json.dumps(config)
|
||||
@@ -758,7 +758,7 @@ async def help_test_entity_debug_info_update_entity_id(hass, mqtt_mock, domain,
|
||||
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
entry.add_to_hass(hass)
|
||||
await async_start(hass, "homeassistant", {}, entry)
|
||||
await async_start(hass, "homeassistant", entry)
|
||||
dev_registry = await hass.helpers.device_registry.async_get_registry()
|
||||
ent_registry = mock_registry(hass, {})
|
||||
|
||||
|
||||
Reference in new issue
Block a user