separated hosts and accounting to host per group and all groups contain mikrotik name #24

This commit is contained in:
tomaae 2020-04-10 09:22:28 +02:00
parent 2c471cc981
commit 07690aad9f
4 changed files with 28 additions and 45 deletions

View file

@ -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):