mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-21 16:39:04 +02:00
Merged System category
Added Visit Device URL
This commit is contained in:
parent
74a4a367dd
commit
448483da22
3 changed files with 31 additions and 3 deletions
|
@ -5,6 +5,7 @@ from typing import Any, Dict, Optional
|
|||
|
||||
from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_HOST,
|
||||
ATTR_ATTRIBUTION,
|
||||
ATTR_DEVICE_CLASS,
|
||||
TEMP_CELSIUS,
|
||||
|
@ -430,10 +431,16 @@ class MikrotikControllerSensor(SensorEntity):
|
|||
@property
|
||||
def device_info(self) -> Dict[str, Any]:
|
||||
"""Return a description for device registry."""
|
||||
if self._type[ATTR_GROUP] == "System":
|
||||
self._type[ATTR_GROUP] = self._ctrl.data["resource"]["board-name"]
|
||||
|
||||
info = {
|
||||
"connections": {(DOMAIN, self._ctrl.data["routerboard"]["serial-number"])},
|
||||
"manufacturer": self._ctrl.data["resource"]["platform"],
|
||||
"model": self._ctrl.data["resource"]["board-name"],
|
||||
"name": f"{self._inst} {self._type[ATTR_GROUP]}",
|
||||
"sw_version": self._ctrl.data["resource"]["version"],
|
||||
"configuration_url": f"http://{self._ctrl.config_entry.data[CONF_HOST]}",
|
||||
}
|
||||
if ATTR_GROUP in self._type:
|
||||
info["identifiers"] = {
|
||||
|
@ -442,7 +449,7 @@ class MikrotikControllerSensor(SensorEntity):
|
|||
"serial-number",
|
||||
self._ctrl.data["routerboard"]["serial-number"],
|
||||
"sensor",
|
||||
self._type[ATTR_GROUP],
|
||||
f"{self._inst} {self._type[ATTR_GROUP]}",
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue