Skip to content

Commit

Permalink
Support synced state (#139)
Browse files Browse the repository at this point in the history
* Support devices appearing in a 'synced' state.

* Support devices appearing in a 'synced' state.
  • Loading branch information
twrecked authored Nov 4, 2023
1 parent 6e7db9e commit e97de43
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 5 additions & 3 deletions pyaarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
TOTAL_LIGHTS_KEY,
LOCATIONS_PATH_FORMAT,
LOCATIONS_EMERGENCY_PATH,
VALID_DEVICE_STATES,
)
from .doorbell import ArloDoorBell
from .light import ArloLight
Expand All @@ -46,7 +47,7 @@

_LOGGER = logging.getLogger("pyaarlo")

__version__ = "0.8.0.1"
__version__ = "0.8.0.2"


class PyArlo(object):
Expand Down Expand Up @@ -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???
Expand Down
2 changes: 2 additions & 0 deletions pyaarlo/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,5 @@
CERT_END = '-----END CERTIFICATE-----\n'

ECDH_CURVES = ['prime256v1', 'secp384r1']

VALID_DEVICE_STATES = ["provisioned", "synced"]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit e97de43

Please sign in to comment.