Add model_id and serial_number to the device description (asuswrt) (#151516)

This commit is contained in:
Yevhenii Vaskivskyi
2025-09-01 18:08:53 +02:00
committed by GitHub
parent f17db80428
commit 0d9079ea72
2 changed files with 16 additions and 0 deletions

View File

@@ -124,6 +124,8 @@ class AsusWrtBridge(ABC):
self._firmware: str | None = None
self._label_mac: str | None = None
self._model: str | None = None
self._model_id: str | None = None
self._serial_number: str | None = None
@property
def host(self) -> str:
@@ -145,6 +147,16 @@ class AsusWrtBridge(ABC):
"""Return model information."""
return self._model
@property
def model_id(self) -> str | None:
"""Return model_id information."""
return self._model_id
@property
def serial_number(self) -> str | None:
"""Return serial number information."""
return self._serial_number
@property
@abstractmethod
def is_connected(self) -> bool:
@@ -361,6 +373,8 @@ class AsusWrtHttpBridge(AsusWrtBridge):
self._label_mac = format_mac(mac)
self._firmware = str(_identity.firmware)
self._model = _identity.model
self._model_id = _identity.product_id
self._serial_number = _identity.serial
async def async_disconnect(self) -> None:
"""Disconnect to the device."""

View File

@@ -391,6 +391,8 @@ class AsusWrtRouter:
identifiers={(DOMAIN, self._entry.unique_id or "AsusWRT")},
name=self.host,
model=self._api.model or "Asus Router",
model_id=self._api.model_id,
serial_number=self._api.serial_number,
manufacturer="Asus",
configuration_url=f"http://{self.host}",
)