-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for linked lock activities (#177)
- Loading branch information
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"id": "0af6bd11-621b-4e32-b0ea-1d13804d31e7", | ||
"timestamp": 1725061953081, | ||
"icon": "https://d3osa7xy9vsc0q.cloudfront.net/app/ActivityFeedIcons/[email protected]", | ||
"action": "linked_lock", | ||
"deviceID": "X", | ||
"deviceType": "lock", | ||
"title": "<b>Front Door</b> locked by linked operation." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"id": "74b5a4b6-8c89-4aac-8eb5-38b0350f4164", | ||
"timestamp": 1725062446640, | ||
"icon": "https://d3osa7xy9vsc0q.cloudfront.net/app/ActivityFeedIcons/[email protected]", | ||
"action": "linked_unlock", | ||
"deviceID": "x", | ||
"deviceType": "lock", | ||
"title": "<b>Front Door</b> unlocked by linked operation." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
|
||
from yalexs.activity import ( | ||
ACTION_BRIDGE_OFFLINE, | ||
ACTION_LINKED_LOCK, | ||
ACTION_LINKED_UNLOCK, | ||
ACTION_BRIDGE_ONLINE, | ||
ACTION_DOOR_CLOSE_2, | ||
ACTION_DOOR_CLOSED, | ||
|
@@ -140,6 +142,8 @@ def test_activity_actions(self): | |
ACTION_LOCK_MANUAL_LOCK, | ||
ACTION_LOCK_MANUAL_UNLATCH, | ||
ACTION_LOCK_MANUAL_UNLOCK, | ||
ACTION_LINKED_LOCK, | ||
ACTION_LINKED_UNLOCK, | ||
], | ||
) | ||
self.assertCountEqual( | ||
|
@@ -506,3 +510,39 @@ def test_websocket_activity(self): | |
) | ||
assert manual_unlock_activity.source == SOURCE_WEBSOCKET | ||
assert manual_unlock_activity.was_pushed is True | ||
|
||
def test_linked_unlock_activity_v4(self): | ||
manual_lock_activity = LockOperationActivity( | ||
SOURCE_LOG, json.loads(load_fixture("linked_unlock_activity.json")) | ||
) | ||
assert manual_lock_activity.operated_by == "Linked Unlock" | ||
assert manual_lock_activity.operated_remote is False | ||
assert manual_lock_activity.operated_keypad is False | ||
assert manual_lock_activity.operated_manual is False | ||
assert manual_lock_activity.operated_tag is False | ||
assert ( | ||
manual_lock_activity.operator_image_url | ||
== "https://d3osa7xy9vsc0q.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
) | ||
assert ( | ||
manual_lock_activity.operator_thumbnail_url | ||
== "https://d3osa7xy9vsc0q.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
) | ||
|
||
def test_linked_lock_activity_v4(self): | ||
manual_lock_activity = LockOperationActivity( | ||
SOURCE_LOG, json.loads(load_fixture("linked_lock_activity.json")) | ||
) | ||
assert manual_lock_activity.operated_by == "Linked Lock" | ||
assert manual_lock_activity.operated_remote is False | ||
assert manual_lock_activity.operated_keypad is False | ||
assert manual_lock_activity.operated_manual is False | ||
assert manual_lock_activity.operated_tag is False | ||
assert ( | ||
manual_lock_activity.operator_image_url | ||
== "https://d3osa7xy9vsc0q.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
) | ||
assert ( | ||
manual_lock_activity.operator_thumbnail_url | ||
== "https://d3osa7xy9vsc0q.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters