diff --git a/changelog b/changelog index 2fbc69e..da385bd 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,5 @@ +0.8.0.2 + Handle 'synced' device state. 0.8.0.1 Better Yahoo IMAP handling. It will now better parse out the emails and better keep track of the used IDs. diff --git a/pyaarlo/__init__.py b/pyaarlo/__init__.py index f5ba0d8..605b4a4 100644 --- a/pyaarlo/__init__.py +++ b/pyaarlo/__init__.py @@ -35,6 +35,7 @@ TOTAL_LIGHTS_KEY, LOCATIONS_PATH_FORMAT, LOCATIONS_EMERGENCY_PATH, + VALID_DEVICE_STATES, ) from .doorbell import ArloDoorBell from .light import ArloLight @@ -46,7 +47,7 @@ _LOGGER = logging.getLogger("pyaarlo") -__version__ = "0.8.0.1" +__version__ = "0.8.0.2" class PyArlo(object): @@ -209,8 +210,9 @@ def __init__(self, **kwargs): for device in self._devices: dname = device.get("deviceName") dtype = device.get("deviceType") - if device.get("state", "unknown") != "provisioned": - self.info("skipping " + dname + ": state unknown") + device_state = device.get("state", "unknown").lower() + if device_state not in VALID_DEVICE_STATES: + self.info(f"skipping {dname}: state is {device_state}") continue # This needs it's own code now... Does no parent indicate a base station??? diff --git a/pyaarlo/constant.py b/pyaarlo/constant.py index 2956dca..23e9930 100644 --- a/pyaarlo/constant.py +++ b/pyaarlo/constant.py @@ -310,3 +310,5 @@ CERT_END = '-----END CERTIFICATE-----\n' ECDH_CURVES = ['prime256v1', 'secp384r1'] + +VALID_DEVICE_STATES = ["provisioned", "synced"] diff --git a/setup.py b/setup.py index ac259bd..0fcaf57 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def readme(): setup( name='pyaarlo', - version='0.8.0.1', + version='0.8.0.2', packages=['pyaarlo'], python_requires='>=3.7',