mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
parent
89e4ee5320
commit
3a9caeffe5
@ -213,7 +213,7 @@ async def async_remove_config_entry_device(
|
|||||||
|
|
||||||
device_mac = None
|
device_mac = None
|
||||||
for connection in device_entry.connections:
|
for connection in device_entry.connections:
|
||||||
if connection[0] == "mac":
|
if connection[0] == dr.CONNECTION_NETWORK_MAC:
|
||||||
device_mac = connection[1]
|
device_mac = connection[1]
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, format_mac
|
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
@ -204,7 +203,7 @@ class NetgearRouter:
|
|||||||
if ntg_device.mac is None:
|
if ntg_device.mac is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
device_mac = format_mac(ntg_device.mac)
|
device_mac = dr.format_mac(ntg_device.mac)
|
||||||
|
|
||||||
if not self.devices.get(device_mac):
|
if not self.devices.get(device_mac):
|
||||||
new_device = True
|
new_device = True
|
||||||
@ -336,7 +335,7 @@ class NetgearDeviceEntity(NetgearBaseEntity):
|
|||||||
def device_info(self) -> DeviceInfo:
|
def device_info(self) -> DeviceInfo:
|
||||||
"""Return the device information."""
|
"""Return the device information."""
|
||||||
return DeviceInfo(
|
return DeviceInfo(
|
||||||
connections={(CONNECTION_NETWORK_MAC, self._mac)},
|
connections={(dr.CONNECTION_NETWORK_MAC, self._mac)},
|
||||||
default_name=self._device_name,
|
default_name=self._device_name,
|
||||||
default_model=self._device["device_model"],
|
default_model=self._device["device_model"],
|
||||||
via_device=(DOMAIN, self._router.unique_id),
|
via_device=(DOMAIN, self._router.unique_id),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user