Add local_ip unique_id & icon and single_instance_allowed (#33483)
* Add config flow + sensor unique_id & icon to local_ip * single_instance_allowed * Fix test * Martin's review * Name deprecated
This commit is contained in:
parent
dd7fbef948
commit
45b28b8b00
8 changed files with 66 additions and 37 deletions
|
@ -9,7 +9,7 @@ from homeassistant.util import get_local_ip
|
|||
@pytest.fixture(name="config")
|
||||
def config_fixture():
|
||||
"""Create hass config fixture."""
|
||||
return {DOMAIN: {"name": "test"}}
|
||||
return {DOMAIN: {}}
|
||||
|
||||
|
||||
async def test_basic_setup(hass, config):
|
||||
|
@ -17,6 +17,6 @@ async def test_basic_setup(hass, config):
|
|||
assert await async_setup_component(hass, DOMAIN, config)
|
||||
await hass.async_block_till_done()
|
||||
local_ip = await hass.async_add_executor_job(get_local_ip)
|
||||
state = hass.states.get("sensor.test")
|
||||
state = hass.states.get(f"sensor.{DOMAIN}")
|
||||
assert state
|
||||
assert state.state == local_ip
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue