mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Add configuration_url to upnp device (#58385)
This commit is contained in:
parent
cfe1bbcda0
commit
be4b1d15ec
@ -21,6 +21,7 @@ from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
from homeassistant.helpers.update_coordinator import (
|
||||
CoordinatorEntity,
|
||||
@ -253,12 +254,13 @@ class UpnpEntity(CoordinatorEntity):
|
||||
self.entity_description = entity_description
|
||||
self._attr_name = f"{coordinator.device.name} {entity_description.name}"
|
||||
self._attr_unique_id = f"{coordinator.device.udn}_{entity_description.unique_id or entity_description.key}"
|
||||
self._attr_device_info = {
|
||||
"connections": {(dr.CONNECTION_UPNP, coordinator.device.udn)},
|
||||
"name": coordinator.device.name,
|
||||
"manufacturer": coordinator.device.manufacturer,
|
||||
"model": coordinator.device.model_name,
|
||||
}
|
||||
self._attr_device_info = DeviceInfo(
|
||||
connections={(dr.CONNECTION_UPNP, coordinator.device.udn)},
|
||||
name=coordinator.device.name,
|
||||
manufacturer=coordinator.device.manufacturer,
|
||||
model=coordinator.device.model_name,
|
||||
configuration_url=f"http://{coordinator.device.hostname}",
|
||||
)
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
|
Loading…
x
Reference in New Issue
Block a user