mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-04 22:44:32 +02:00
Device tracker and accounting sensor uses default_name and does not add manufacturer and model data #57
This commit is contained in:
parent
a29cce0d3d
commit
41f9ad97c9
3 changed files with 19 additions and 4 deletions
|
@ -383,3 +383,18 @@ class MikrotikControllerHostDeviceTracker(MikrotikControllerDeviceTracker):
|
||||||
attributes[format_attribute(variable)] = self._data[variable]
|
attributes[format_attribute(variable)] = self._data[variable]
|
||||||
|
|
||||||
return attributes
|
return attributes
|
||||||
|
|
||||||
|
@property
|
||||||
|
def device_info(self):
|
||||||
|
"""Return a description for device registry."""
|
||||||
|
info = {
|
||||||
|
"connections": {
|
||||||
|
(CONNECTION_NETWORK_MAC, self._data[self._sid_data["sid_ref"]])
|
||||||
|
},
|
||||||
|
#"manufacturer": self._ctrl.data["resource"]["platform"],
|
||||||
|
#"model": self._ctrl.data["resource"]["board-name"],
|
||||||
|
"default_name": self._data[self._sid_data["sid_name"]],
|
||||||
|
}
|
||||||
|
if self._sid_data["sid"] == "interface":
|
||||||
|
info["name"] = f"{self._inst} {self._data[self._sid_data['sid_name']]}"
|
||||||
|
return info
|
|
@ -430,9 +430,9 @@ class MikrotikAccountingSensor(MikrotikControllerSensor):
|
||||||
"""Return a accounting description for device registry."""
|
"""Return a accounting description for device registry."""
|
||||||
info = {
|
info = {
|
||||||
"connections": {(CONNECTION_NETWORK_MAC, self._data["mac-address"])},
|
"connections": {(CONNECTION_NETWORK_MAC, self._data["mac-address"])},
|
||||||
"manufacturer": self._ctrl.data["resource"]["platform"],
|
#"manufacturer": self._ctrl.data["resource"]["platform"],
|
||||||
"model": self._ctrl.data["resource"]["board-name"],
|
#"model": self._ctrl.data["resource"]["board-name"],
|
||||||
"name": self._data["host-name"],
|
"default_name": self._data["host-name"],
|
||||||
}
|
}
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Mikrotik Router",
|
"name": "Mikrotik Router",
|
||||||
"homeassistant": "0.110.0",
|
"homeassistant": "0.114.0",
|
||||||
"iot_class": "local_poll",
|
"iot_class": "local_poll",
|
||||||
"domains": ["device_tracker", "switch", "sensor", "binary_sensor"],
|
"domains": ["device_tracker", "switch", "sensor", "binary_sensor"],
|
||||||
"render_readme": false,
|
"render_readme": false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue