mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-23 17:28:51 +02:00
separated hosts and accounting to host per group and all groups contain mikrotik name #24
This commit is contained in:
parent
2c471cc981
commit
07690aad9f
4 changed files with 28 additions and 45 deletions
|
@ -122,19 +122,21 @@ class MikrotikControllerBinarySensor(BinarySensorDevice):
|
|||
def device_info(self):
|
||||
"""Return a port description for device registry."""
|
||||
info = {
|
||||
"identifiers": {
|
||||
"manufacturer": self._ctrl.data["resource"]["platform"],
|
||||
"model": self._ctrl.data["resource"]["board-name"],
|
||||
"name": f"{self._inst} {self._type[ATTR_GROUP]}",
|
||||
}
|
||||
if ATTR_GROUP in self._type:
|
||||
info["identifiers"] = {
|
||||
(
|
||||
DOMAIN,
|
||||
"serial-number",
|
||||
self._ctrl.data["routerboard"]["serial-number"],
|
||||
"switch",
|
||||
"PORT",
|
||||
self._type[ATTR_GROUP],
|
||||
)
|
||||
},
|
||||
"manufacturer": self._ctrl.data["resource"]["platform"],
|
||||
"model": self._ctrl.data["resource"]["board-name"],
|
||||
"name": self._type[ATTR_GROUP],
|
||||
}
|
||||
}
|
||||
|
||||
return info
|
||||
|
||||
async def async_update(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue