mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +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.exceptions import ConfigEntryNotReady
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
@ -253,12 +254,13 @@ class UpnpEntity(CoordinatorEntity):
|
|||||||
self.entity_description = entity_description
|
self.entity_description = entity_description
|
||||||
self._attr_name = f"{coordinator.device.name} {entity_description.name}"
|
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_unique_id = f"{coordinator.device.udn}_{entity_description.unique_id or entity_description.key}"
|
||||||
self._attr_device_info = {
|
self._attr_device_info = DeviceInfo(
|
||||||
"connections": {(dr.CONNECTION_UPNP, coordinator.device.udn)},
|
connections={(dr.CONNECTION_UPNP, coordinator.device.udn)},
|
||||||
"name": coordinator.device.name,
|
name=coordinator.device.name,
|
||||||
"manufacturer": coordinator.device.manufacturer,
|
manufacturer=coordinator.device.manufacturer,
|
||||||
"model": coordinator.device.model_name,
|
model=coordinator.device.model_name,
|
||||||
}
|
configuration_url=f"http://{coordinator.device.hostname}",
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user