mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Add model ID to unifiprotect (#125376)
This commit is contained in:
parent
aa619c5594
commit
c3921f2112
@ -278,7 +278,8 @@ class ProtectDeviceEntity(BaseProtectEntity):
|
||||
self._attr_device_info = DeviceInfo(
|
||||
name=self.device.display_name,
|
||||
manufacturer=DEFAULT_BRAND,
|
||||
model=self.device.type,
|
||||
model=self.device.market_name or self.device.type,
|
||||
model_id=self.device.type,
|
||||
via_device=(DOMAIN, self.data.api.bootstrap.nvr.mac),
|
||||
sw_version=self.device.firmware_version,
|
||||
connections={(dr.CONNECTION_NETWORK_MAC, self.device.mac)},
|
||||
|
@ -32,7 +32,7 @@ from homeassistant.const import (
|
||||
Platform,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .utils import (
|
||||
@ -66,6 +66,14 @@ def validate_default_camera_entity(
|
||||
assert entity.disabled is False
|
||||
assert entity.unique_id == unique_id
|
||||
|
||||
device_registry = dr.async_get(hass)
|
||||
device = device_registry.async_get(entity.device_id)
|
||||
assert device
|
||||
assert device.manufacturer == "Ubiquiti"
|
||||
assert device.name == camera_obj.name
|
||||
assert device.model == camera_obj.market_name or camera_obj.type
|
||||
assert device.model_id == camera_obj.type
|
||||
|
||||
return entity_id
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user