diff --git a/homeassistant/components/upnp/__init__.py b/homeassistant/components/upnp/__init__.py index 38356d0af16..bbb49ebd1d4 100644 --- a/homeassistant/components/upnp/__init__.py +++ b/homeassistant/components/upnp/__init__.py @@ -162,6 +162,7 @@ async def async_setup_entry(hass: HomeAssistantType, config_entry: ConfigEntry): identifiers={(DOMAIN, device.udn)}, name=device.name, manufacturer=device.manufacturer, + model=device.model_name, ) # set up sensors diff --git a/homeassistant/components/upnp/device.py b/homeassistant/components/upnp/device.py index 7f7f0f5b93a..de3c93a82ed 100644 --- a/homeassistant/components/upnp/device.py +++ b/homeassistant/components/upnp/device.py @@ -78,6 +78,11 @@ class Device: """Get the manufacturer.""" return self._igd_device.manufacturer + @property + def model_name(self): + """Get the model name.""" + return self._igd_device.model_name + async def async_add_port_mappings(self, ports, local_ip): """Add port mappings.""" if local_ip == "127.0.0.1": diff --git a/homeassistant/components/upnp/sensor.py b/homeassistant/components/upnp/sensor.py index 40cb7ef2032..4c85e904b1d 100644 --- a/homeassistant/components/upnp/sensor.py +++ b/homeassistant/components/upnp/sensor.py @@ -2,6 +2,7 @@ import logging from homeassistant.core import callback +from homeassistant.helpers import device_registry as dr from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from homeassistant.helpers.typing import HomeAssistantType @@ -93,9 +94,11 @@ class UpnpSensor(Entity): def device_info(self): """Get device info.""" return { - "identifiers": {(DOMAIN_UPNP, self.unique_id)}, - "name": self.name, + "connections": {(dr.CONNECTION_UPNP, self._device.udn)}, + "identifiers": {(DOMAIN_UPNP, self._device.udn)}, + "name": self._device.name, "manufacturer": self._device.manufacturer, + "model": self._device.model_name, }