Fix Netgear used method version (#63686)

* Netgear fix used method version

* add error message

* fix imports

* fix black

* fix error mess

* rename const
This commit is contained in:
starkillerOG 2022-01-09 11:27:42 +01:00 committed by GitHub
parent 6c6607b5be
commit 1d24fb7ad9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 9 deletions

View file

@ -149,6 +149,14 @@ class NetgearRouter:
if self.model.startswith(model):
self.method_version = 2
if self.method_version == 2:
if not self._api.get_attached_devices_2():
_LOGGER.error(
"Netgear Model '%s' in MODELS_V2 list, but failed to get attached devices using V2",
self.model,
)
self.method_version = 1
async def async_setup(self) -> None:
"""Set up a Netgear router."""
await self.hass.async_add_executor_job(self._setup)