diff --git a/custom_components/ninlight/sensor.py b/custom_components/ninlight/sensor.py index 0ee31a2..57fcbaa 100644 --- a/custom_components/ninlight/sensor.py +++ b/custom_components/ninlight/sensor.py @@ -56,7 +56,6 @@ SENSORS = ( NinlightSensorDescription( key="ip_address", translation_key="ip_address", - entity_registry_enabled_default=False, value_fn=lambda data: _wifi(data).get("ip"), ), NinlightSensorDescription( diff --git a/tests/test_sensor.py b/tests/test_sensor.py index 449618b..3eda9c4 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -13,7 +13,7 @@ from pytest_homeassistant_custom_component.common import MockConfigEntry, async_ from tests.helpers import entity_id_for -DISABLED_KEYS = ("ip_address", "free_heap", "last_ota_error", "boot_time") +DISABLED_KEYS = ("free_heap", "last_ota_error", "boot_time") async def _enable_all( @@ -41,11 +41,12 @@ async def _poll(hass: HomeAssistant, freezer: FrozenDateTimeFactory, seconds: in await hass.async_block_till_done() -async def test_signal_enabled_others_disabled_by_default( +async def test_signal_and_ip_enabled_others_disabled_by_default( hass: HomeAssistant, init_integration ) -> None: registry = er.async_get(hass) assert hass.states.get(entity_id_for(hass, "sensor", "rssi")).state == "-61" + assert hass.states.get(entity_id_for(hass, "sensor", "ip_address")).state == "192.168.2.22" for key in DISABLED_KEYS: entry = registry.async_get(entity_id_for(hass, "sensor", key)) assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION, key