diff --git a/homeassistant/components/tasmota/__init__.py b/homeassistant/components/tasmota/__init__.py index 5599f887f8f..b863cda796d 100644 --- a/homeassistant/components/tasmota/__init__.py +++ b/homeassistant/components/tasmota/__init__.py @@ -5,6 +5,7 @@ import asyncio import logging from hatasmota.const import ( + CONF_IP, CONF_MAC, CONF_MANUFACTURER, CONF_MODEL, @@ -165,12 +166,13 @@ def _update_device( """Add or update device registry.""" _LOGGER.debug("Adding or updating tasmota device %s", config[CONF_MAC]) device_registry.async_get_or_create( + config_entry_id=config_entry.entry_id, + configuration_url=f"http://{config[CONF_IP]}/", connections={(CONNECTION_NETWORK_MAC, config[CONF_MAC])}, manufacturer=config[CONF_MANUFACTURER], model=config[CONF_MODEL], name=config[CONF_NAME], sw_version=config[CONF_SW_VERSION], - config_entry_id=config_entry.entry_id, ) diff --git a/tests/components/tasmota/test_discovery.py b/tests/components/tasmota/test_discovery.py index 3e1175faa0f..713d0f5ae67 100644 --- a/tests/components/tasmota/test_discovery.py +++ b/tests/components/tasmota/test_discovery.py @@ -150,6 +150,7 @@ async def test_device_discover( set(), {(dr.CONNECTION_NETWORK_MAC, mac)} ) assert device_entry is not None + assert device_entry.configuration_url == f"http://{config['ip']}/" assert device_entry.manufacturer == "Tasmota" assert device_entry.model == config["md"] assert device_entry.name == config["dn"]