mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-05 15:04:30 +02:00
fixed "Ignoring invalid device info" error from 2023.8, fixes #292
This commit is contained in:
parent
5186956883
commit
51c9c62859
1 changed files with 21 additions and 13 deletions
|
@ -237,14 +237,22 @@ class MikrotikEntity(CoordinatorEntity[MikrotikCoordinator], Entity):
|
||||||
dev_connection_value = dev_connection_value[6:]
|
dev_connection_value = dev_connection_value[6:]
|
||||||
dev_connection_value = self._data[dev_connection_value]
|
dev_connection_value = self._data[dev_connection_value]
|
||||||
|
|
||||||
|
if self.entity_description.ha_group == "System":
|
||||||
info = DeviceInfo(
|
info = DeviceInfo(
|
||||||
connections={(dev_connection, f"{dev_connection_value}")},
|
connections={(dev_connection, f"{dev_connection_value}")},
|
||||||
identifiers={(dev_connection, f"{dev_connection_value}")},
|
identifiers={(dev_connection, f"{dev_connection_value}")},
|
||||||
|
name=f"{self._inst} {dev_group}",
|
||||||
|
model=f"{self.coordinator.data['resource']['board-name']}",
|
||||||
|
manufacturer=f"{self.coordinator.data['resource']['platform']}",
|
||||||
|
sw_version=f"{self.coordinator.data['resource']['version']}",
|
||||||
|
configuration_url=f"http://{self.coordinator.config_entry.data[CONF_HOST]}",
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
info = DeviceInfo(
|
||||||
|
connections={(dev_connection, f"{dev_connection_value}")},
|
||||||
default_name=f"{self._inst} {dev_group}",
|
default_name=f"{self._inst} {dev_group}",
|
||||||
default_model=f"{self.coordinator.data['resource']['board-name']}",
|
default_model=f"{self.coordinator.data['resource']['board-name']}",
|
||||||
default_manufacturer=f"{self.coordinator.data['resource']['platform']}",
|
default_manufacturer=f"{self.coordinator.data['resource']['platform']}",
|
||||||
sw_version=f"{self.coordinator.data['resource']['version']}",
|
|
||||||
configuration_url=f"http://{self.coordinator.config_entry.data[CONF_HOST]}",
|
|
||||||
via_device=(
|
via_device=(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
f"{self.coordinator.data['routerboard']['serial-number']}",
|
f"{self.coordinator.data['routerboard']['serial-number']}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue