Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #60 from dknowles2/unavailable
Browse files Browse the repository at this point in the history
Handle locks being unavailable
  • Loading branch information
dknowles2 committed Apr 11, 2023
2 parents 4acda87 + d58a044 commit ee15df2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions custom_components/schlage/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def _handle_coordinator_update(self) -> None:

def _update_attrs(self) -> None:
self._attr_name = f"{self._lock.name} Lock"
# When is_locked is None the lock is unavailable.
self._attr_available = self._lock.is_locked is not None
self._attr_is_locked = self._lock.is_locked
self._attr_is_jammed = self._lock.is_jammed
self._attr_device_info = DeviceInfo(
Expand Down
4 changes: 2 additions & 2 deletions custom_components/schlage/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/dknowles2/ha-schlage/issues",
"requirements": [
"pyschlage==2023.4.0"
"pyschlage==2023.4.1"
],
"version": "2023.4.0"
"version": "2023.4.1"
}
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest-homeassistant-custom-component==0.13.19
pyschlage==2023.3.2
pyschlage==2023.4.1

0 comments on commit ee15df2

Please sign in to comment.