Skip to content

Commit

Permalink
Merge pull request #51 from jesserockz/patch-1
Browse files Browse the repository at this point in the history
Add Pro 4 & Essential capabilities
  • Loading branch information
twrecked authored Nov 2, 2020
2 parents 2b485d0 + 4b1b83a commit 409ad31
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
19 changes: 14 additions & 5 deletions pyaarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,21 @@ def __init__(self, **kwargs):
continue

# This needs it's own code now... Does no parent indicate a base station???
if dtype == 'basestation' or \
device.get('modelId') == 'ABC1000' or dtype == 'arloq' or dtype == 'arloqs' or \
device.get("modelId").startswith("FB1001A"):
if (
dtype == "basestation"
or device.get("modelId") == "ABC1000"
or dtype == "arloq"
or dtype == "arloqs"
):
self._bases.append(ArloBase(dname, self, device))
# video doorbell can be its own base station, it can also be assigned to a real base station
if device.get('modelId').startswith('AVD1001'):
# Newer devices can connect directly to wifi and can be its own base station,
# it can also be assigned to a real base station
if (
device.get("modelId").startswith("AVD1001")
or device.get("modelId").startswith("FB1001")
or device.get("modelId").startswith("VMC4041")
or device.get("modelId").startswith("VMC2030")
):
parent_id = device.get('parentId', None)
if parent_id is None or parent_id == device.get('deviceId', None):
self._bases.append(ArloBase(dname, self, device))
Expand Down
8 changes: 4 additions & 4 deletions pyaarlo/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,15 +1235,15 @@ def has_capability(self, cap):
return True
if cap in (AUDIO_DETECTED_KEY,):
if self.model_id.startswith(
('VMC4030', 'VMC4040', 'VMC5040', 'ABC1000', 'FB1001')):
('VMC2030', 'VMC4030', 'VMC4040', 'VMC4041', 'VMC5040', 'ABC1000', 'FB1001')):
return True
if self.device_type.startswith('arloq'):
return True
if cap in (SIREN_STATE_KEY,):
if self.model_id.startswith(('VMC4040', 'VMC5040', 'FB1001')):
if self.model_id.startswith(('VMC2030', 'VMC4040', 'VMC4041', 'VMC5040', 'FB1001')):
return True
if cap in (SPOTLIGHT_KEY,):
if self.model_id.startswith(('VMC4040', 'VMC5040')):
if self.model_id.startswith(('VMC2030', 'VMC4040', 'VMC4041', 'VMC5040')):
return True
if cap in (TEMPERATURE_KEY, HUMIDITY_KEY, AIR_QUALITY_KEY):
if self.model_id.startswith('ABC1000'):
Expand All @@ -1256,7 +1256,7 @@ def has_capability(self, cap):
return True
if cap in (CONNECTION_KEY,):
# These devices are their own base stations so don't re-add connection key.
if self.model_id.startswith(('ABC1000', 'FB1001A')):
if self.model_id.startswith(('ABC1000', 'FB1001', 'VMC2030', 'VMC4041')):
return False
if self.device_type in ('arloq', 'arloqs'):
return False
Expand Down

0 comments on commit 409ad31

Please sign in to comment.