mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +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"
|
DEFAULT_NAME = "Netgear router"
|
||||||
|
|
||||||
# update method V2 models
|
# 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
|
# Icons
|
||||||
DEVICE_ICONS = {
|
DEVICE_ICONS = {
|
||||||
|
@ -146,8 +146,9 @@ class NetgearRouter:
|
|||||||
self.model = self._info.get("ModelName")
|
self.model = self._info.get("ModelName")
|
||||||
self.firmware_version = self._info.get("Firmwareversion")
|
self.firmware_version = self._info.get("Firmwareversion")
|
||||||
|
|
||||||
if self.model in MODELS_V2:
|
for model in MODELS_V2:
|
||||||
self._method_version = 2
|
if self.model.startswith(model):
|
||||||
|
self._method_version = 2
|
||||||
|
|
||||||
async def async_setup(self) -> None:
|
async def async_setup(self) -> None:
|
||||||
"""Set up a Netgear router."""
|
"""Set up a Netgear router."""
|
||||||
@ -198,12 +199,12 @@ class NetgearRouter:
|
|||||||
ntg_devices = await self.async_get_attached_devices()
|
ntg_devices = await self.async_get_attached_devices()
|
||||||
now = dt_util.utcnow()
|
now = dt_util.utcnow()
|
||||||
|
|
||||||
|
if _LOGGER.isEnabledFor(logging.DEBUG):
|
||||||
|
_LOGGER.debug("Netgear scan result: \n%s", ntg_devices)
|
||||||
|
|
||||||
for ntg_device in ntg_devices:
|
for ntg_device in ntg_devices:
|
||||||
device_mac = format_mac(ntg_device.mac)
|
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):
|
if not self.devices.get(device_mac):
|
||||||
new_device = True
|
new_device = True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user