diff --git a/tests/components/ping/test_binary_sensor.py b/tests/components/ping/test_binary_sensor.py index b1066895e2b..68f647008e3 100644 --- a/tests/components/ping/test_binary_sensor.py +++ b/tests/components/ping/test_binary_sensor.py @@ -50,8 +50,10 @@ async def test_disabled_after_import( entity_registry: er.EntityRegistry, ): """Test if binary sensor is disabled after import.""" - config_entry.data = {CONF_IMPORTED_BY: "device_tracker"} config_entry.add_to_hass(hass) + hass.config_entries.async_update_entry( + config_entry, data={CONF_IMPORTED_BY: "device_tracker"} + ) assert await async_setup_component(hass, DOMAIN, {}) await hass.async_block_till_done()