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:
starkillerOG 2021-10-06 13:30:13 +02:00 committed by GitHub
parent 8337baa354
commit 3e89ebb1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 6 deletions

View File

@ -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 = {

View File

@ -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