mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove Netgear tracker link_rate check on Orbi (#57032)
* Netgear tracker: remove link_rate check on Orbi * fix debug message * Add orbi models * check start of model in V2 check * fix black
This commit is contained in:
parent
8337baa354
commit
3e89ebb1cb
@ -11,7 +11,24 @@ DEFAULT_CONSIDER_HOME = timedelta(seconds=180)
|
||||
DEFAULT_NAME = "Netgear router"
|
||||
|
||||
# update method V2 models
|
||||
MODELS_V2 = ["Orbi"]
|
||||
MODELS_V2 = [
|
||||
"Orbi",
|
||||
"RBK",
|
||||
"RBR",
|
||||
"RBS",
|
||||
"RBW",
|
||||
"LBK",
|
||||
"LBR",
|
||||
"CBK",
|
||||
"CBR",
|
||||
"SRC",
|
||||
"SRK",
|
||||
"SRR",
|
||||
"SRS",
|
||||
"SXK",
|
||||
"SXR",
|
||||
"SXS",
|
||||
]
|
||||
|
||||
# Icons
|
||||
DEVICE_ICONS = {
|
||||
|
@ -146,8 +146,9 @@ class NetgearRouter:
|
||||
self.model = self._info.get("ModelName")
|
||||
self.firmware_version = self._info.get("Firmwareversion")
|
||||
|
||||
if self.model in MODELS_V2:
|
||||
self._method_version = 2
|
||||
for model in MODELS_V2:
|
||||
if self.model.startswith(model):
|
||||
self._method_version = 2
|
||||
|
||||
async def async_setup(self) -> None:
|
||||
"""Set up a Netgear router."""
|
||||
@ -198,12 +199,12 @@ class NetgearRouter:
|
||||
ntg_devices = await self.async_get_attached_devices()
|
||||
now = dt_util.utcnow()
|
||||
|
||||
if _LOGGER.isEnabledFor(logging.DEBUG):
|
||||
_LOGGER.debug("Netgear scan result: \n%s", ntg_devices)
|
||||
|
||||
for ntg_device in ntg_devices:
|
||||
device_mac = format_mac(ntg_device.mac)
|
||||
|
||||
if self._method_version == 2 and not ntg_device.link_rate:
|
||||
continue
|
||||
|
||||
if not self.devices.get(device_mac):
|
||||
new_device = True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user