diff --git a/tests/components/dsmr_reader/test_definitions.py b/tests/components/dsmr_reader/test_definitions.py index 86805fb456f..dc6cdc1b41a 100644 --- a/tests/components/dsmr_reader/test_definitions.py +++ b/tests/components/dsmr_reader/test_definitions.py @@ -4,15 +4,13 @@ import pytest from homeassistant.components.dsmr_reader.const import DOMAIN from homeassistant.components.dsmr_reader.definitions import ( - DSMRReaderSensorEntityDescription, dsmr_transform, tariff_transform, ) -from homeassistant.components.dsmr_reader.sensor import DSMRSensor from homeassistant.const import STATE_UNKNOWN from homeassistant.core import HomeAssistant -from tests.common import MockConfigEntry, MockEntityPlatform, async_fire_mqtt_message +from tests.common import MockConfigEntry, async_fire_mqtt_message @pytest.mark.parametrize( @@ -71,7 +69,7 @@ async def test_entity_tariff(hass: HomeAssistant) -> None: assert hass.states.get(electricity_tariff).state == "low" -@pytest.mark.usefixtures("mqtt_mock") +@pytest.mark.usefixtures("entity_registry_enabled_by_default", "mqtt_mock") async def test_entity_dsmr_transform(hass: HomeAssistant) -> None: """Test the state attribute of DSMRReaderSensorEntityDescription when a dsmr transform is needed.""" config_entry = MockConfigEntry( @@ -85,17 +83,6 @@ async def test_entity_dsmr_transform(hass: HomeAssistant) -> None: assert await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() - # Create the entity, since it's not by default - description = DSMRReaderSensorEntityDescription( - key="dsmr/meter-stats/dsmr_version", - name="version_test", - state=dsmr_transform, - ) - sensor = DSMRSensor(description, config_entry) - sensor.hass = hass - sensor.platform = MockEntityPlatform(hass) - await sensor.async_added_to_hass() - # Test dsmr version, if it's a digit async_fire_mqtt_message(hass, "dsmr/meter-stats/dsmr_version", "42") await hass.async_block_till_done()