1
0
mirror of https://github.com/USA-RedDragon/badnest.git synced 2025-01-18 13:15:25 +00:00

Fix typo in _get_devices() name

Fixes #108 

This fixes the immediate problem that this method doesn't exist, but reveals a larger problem that calling `._get_devices()` in the error handler of `_get_devices()` can cause an infinite loop.  On my instance now with this change, hass won't start up anymore and logs show this message:

```
2020-04-18 23:04:36 WARNING (MainThread) [homeassistant.setup] Setup of badnest is taking over 10 seconds.
```

Reworking error handling to try N times and then permanently fail would be better than this infinite loop, but that's a separate PR.
This commit is contained in:
Andrew Ash 2020-04-18 23:12:25 -07:00 committed by GitHub
parent 7ab48d968e
commit 709b9c0a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,11 +160,11 @@ class NestAPI():
except requests.exceptions.RequestException as e:
_LOGGER.error(e)
_LOGGER.error('Failed to get devices, trying again')
return self.get_devices()
return self._get_devices()
except KeyError:
_LOGGER.debug('Failed to get devices, trying to log in again')
self.login()
return self.get_devices()
return self._get_devices()
def _map_nest_protect_state(self, value):