Skip to content

Commit

Permalink
Support 'synced' state for devices. (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
twrecked authored Dec 1, 2023
1 parent 830f319 commit 439707a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
aarlo/pyaarlo
0.7.4.2:
Support 'synced' state
0.7.4.1:
Fix camera recording issue.
0.7.4:
Expand Down
4 changes: 2 additions & 2 deletions custom_components.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"aarlo": {
"version": "0.7.4.1",
"version": "0.7.4.2",
"local_location": "/custom_components/aarlo/__init__.py",
"remote_location": "https://raw.githubusercontent.com/twrecked/hass-aarlo/master/custom_components/aarlo/__init__.py",
"visit_repo": "https://github.com/twrecked/hass-aarlo",
Expand All @@ -18,7 +18,7 @@
]
},
"pyaarlo": {
"version": "0.7.4.1",
"version": "0.7.4.2",
"local_location": "/custom_components/aarlo/pyaarlo/__init__.py",
"remote_location": "https://raw.githubusercontent.com/twrecked/hass-aarlo/master/custom_components/aarlo/pyaarlo/__init__.py",
"visit_repo": "https://github.com/twrecked/hass-aarlo",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
SIREN_STATE_KEY
)

__version__ = "0.7.4.1"
__version__ = "0.7.4.2"

_LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "cloud_push",
"issue_tracker": "https://github.com/twrecked/hass-aarlo/issues",
"requirements": ["unidecode","cloudscraper>=1.2.71", "paho-mqtt"],
"version": "0.7.4.1"
"version": "0.7.4.2"
}
8 changes: 5 additions & 3 deletions custom_components/aarlo/pyaarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
TOTAL_LIGHTS_KEY,
LOCATIONS_PATH_FORMAT,
LOCATIONS_EMERGENCY_PATH,
VALID_DEVICE_STATES,
)
from .doorbell import ArloDoorBell
from .light import ArloLight
Expand All @@ -45,7 +46,7 @@

_LOGGER = logging.getLogger("pyaarlo")

__version__ = "0.7.4.1"
__version__ = "0.7.4.2"


class PyArlo(object):
Expand Down Expand Up @@ -202,8 +203,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 custom_components/aarlo/pyaarlo/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,5 @@
MODEL_GO = "VML4030"

MODEL_ALL_IN_1_SENSOR = "MS1001"

VALID_DEVICE_STATES = ["provisioned", "synced"]

0 comments on commit 439707a

Please sign in to comment.