feat: IP-Adresse standardmaessig als Entitaet aktiv
Die IP ist der Wert, den man beim Suchen einer Lampe zuerst braucht - als abgeschaltete Diagnose-Entitaet war sie genau dann nicht da.
This commit is contained in:
@@ -56,7 +56,6 @@ SENSORS = (
|
|||||||
NinlightSensorDescription(
|
NinlightSensorDescription(
|
||||||
key="ip_address",
|
key="ip_address",
|
||||||
translation_key="ip_address",
|
translation_key="ip_address",
|
||||||
entity_registry_enabled_default=False,
|
|
||||||
value_fn=lambda data: _wifi(data).get("ip"),
|
value_fn=lambda data: _wifi(data).get("ip"),
|
||||||
),
|
),
|
||||||
NinlightSensorDescription(
|
NinlightSensorDescription(
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from pytest_homeassistant_custom_component.common import MockConfigEntry, async_
|
|||||||
|
|
||||||
from tests.helpers import entity_id_for
|
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(
|
async def _enable_all(
|
||||||
@@ -41,11 +41,12 @@ async def _poll(hass: HomeAssistant, freezer: FrozenDateTimeFactory, seconds: in
|
|||||||
await hass.async_block_till_done()
|
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
|
hass: HomeAssistant, init_integration
|
||||||
) -> None:
|
) -> None:
|
||||||
registry = er.async_get(hass)
|
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", "rssi")).state == "-61"
|
||||||
|
assert hass.states.get(entity_id_for(hass, "sensor", "ip_address")).state == "192.168.2.22"
|
||||||
for key in DISABLED_KEYS:
|
for key in DISABLED_KEYS:
|
||||||
entry = registry.async_get(entity_id_for(hass, "sensor", key))
|
entry = registry.async_get(entity_id_for(hass, "sensor", key))
|
||||||
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION, key
|
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION, key
|
||||||
|
|||||||
Reference in New Issue
Block a user