diff --git a/pyaarlo/location.py b/pyaarlo/location.py index 8d6d21a..212e7ca 100644 --- a/pyaarlo/location.py +++ b/pyaarlo/location.py @@ -155,6 +155,9 @@ def update_mode(self): """Check and update the base's current mode.""" data = self._arlo.be.get(LOCATION_ACTIVEMODE_PATH_FORMAT.format(self._id), headers=self._extra_headers()) + if data is None: + self._arlo.error("failed to read active mode.") + return mode_id = data.get("properties", {}).get('mode') mode_revision = data.get("revision") self._save_and_do_callbacks(MODE_KEY, mode_id)