Reolink late review comments (#87991)

late review comments
This commit is contained in:
starkillerOG 2023-02-13 11:47:39 +01:00 committed by GitHub
parent 89e4ee5320
commit 3a9caeffe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -213,7 +213,7 @@ async def async_remove_config_entry_device(
device_mac = None
for connection in device_entry.connections:
if connection[0] == "mac":
if connection[0] == dr.CONNECTION_NETWORK_MAC:
device_mac = connection[1]
break

View File

@ -19,7 +19,6 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant, callback
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.update_coordinator import (
CoordinatorEntity,
@ -204,7 +203,7 @@ class NetgearRouter:
if ntg_device.mac is None:
continue
device_mac = format_mac(ntg_device.mac)
device_mac = dr.format_mac(ntg_device.mac)
if not self.devices.get(device_mac):
new_device = True
@ -336,7 +335,7 @@ class NetgearDeviceEntity(NetgearBaseEntity):
def device_info(self) -> DeviceInfo:
"""Return the device information."""
return DeviceInfo(
connections={(CONNECTION_NETWORK_MAC, self._mac)},
connections={(dr.CONNECTION_NETWORK_MAC, self._mac)},
default_name=self._device_name,
default_model=self._device["device_model"],
via_device=(DOMAIN, self._router.unique_id),