-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from bdraco/bridge_and_doorsense
Expose bridge information and if doorsense is installed
- Loading branch information
Showing
8 changed files
with
256 additions
and
15 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
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,56 @@ | ||
from enum import Enum | ||
|
||
from august.device import DeviceDetail | ||
|
||
|
||
class BridgeStatus(Enum): | ||
ONLINE = "online" | ||
UNKNOWN = "unknown" | ||
|
||
|
||
class BridgeDetail(DeviceDetail): | ||
def __init__(self, house_id, data): | ||
super().__init__(data["_id"], None, house_id, None, data["firmwareVersion"]) | ||
|
||
self._operative = data["operative"] | ||
|
||
if "status" in data: | ||
self._status = BridgeStatusDetail(data["status"]) | ||
else: | ||
self._status = None | ||
|
||
@property | ||
def status(self): | ||
return self._status | ||
|
||
@property | ||
def operative(self): | ||
return self._operative | ||
|
||
|
||
class BridgeStatusDetail: | ||
def __init__(self, data): | ||
self._current = BridgeStatus.UNKNOWN | ||
|
||
if "current" in data and data["current"] == "online": | ||
self._current = BridgeStatus.ONLINE | ||
|
||
self._updated = data["updated"] if "updated" in data else None | ||
self._last_online = data["lastOnline"] if "lastOnline" in data else None | ||
self._last_offline = data["lastOffline"] if "lastOffline" in data else None | ||
|
||
@property | ||
def current(self): | ||
return self._current | ||
|
||
@property | ||
def updated(self): | ||
return self._updated | ||
|
||
@property | ||
def last_online(self): | ||
return self._last_online | ||
|
||
@property | ||
def last_offline(self): | ||
return self._last_offline |
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
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
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,68 @@ | ||
{ | ||
"Calibrated" : false, | ||
"Created" : "2000-00-00T00:00:00.447Z", | ||
"HouseID" : "houseid", | ||
"HouseName" : "MockName", | ||
"LockID" : "ABC", | ||
"LockName" : "Test", | ||
"LockStatus" : { | ||
"status" : "unknown" | ||
}, | ||
"OfflineKeys" : { | ||
"created" : [], | ||
"createdhk" : [ | ||
{ | ||
"UserID" : "mock-user-id", | ||
"created" : "2000-00-00T00:00:00.447Z", | ||
"key" : "mockkey", | ||
"slot" : 12 | ||
} | ||
], | ||
"deleted" : [], | ||
"loaded" : [ | ||
{ | ||
"UserID" : "userid", | ||
"created" : "2000-00-00T00:00:00.447Z", | ||
"key" : "key", | ||
"loaded" : "2000-00-00T00:00:00.447Z", | ||
"slot" : 1 | ||
} | ||
] | ||
}, | ||
"SerialNumber" : "ABC", | ||
"Type" : 3, | ||
"Updated" : "2000-00-00T00:00:00.447Z", | ||
"battery" : -1, | ||
"cameras" : [], | ||
"currentFirmwareVersion" : "undefined-1.59.0-1.13.2", | ||
"geofenceLimits" : { | ||
"ios" : { | ||
"debounceInterval" : 90, | ||
"gpsAccuracyMultiplier" : 2.5, | ||
"maximumGeofence" : 5000, | ||
"minGPSAccuracyRequired" : 80, | ||
"minimumGeofence" : 100 | ||
} | ||
}, | ||
"homeKitEnabled" : false, | ||
"isGalileo" : false, | ||
"macAddress" : "a:b:c", | ||
"parametersToSet" : {}, | ||
"pubsubChannel" : "mockpubsub", | ||
"ruleHash" : {}, | ||
"skuNumber" : "AUG-X", | ||
"supportsEntryCodes" : false, | ||
"users" : { | ||
"mockuserid" : { | ||
"FirstName" : "MockName", | ||
"LastName" : "House", | ||
"UserType" : "superuser", | ||
"identifiers" : [ | ||
"phone:+15558675309", | ||
"email:mockme@mock.org" | ||
] | ||
} | ||
}, | ||
"zWaveDSK" : "1-2-3-4", | ||
"zWaveEnabled" : true | ||
} |
File renamed without changes.
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,51 @@ | ||
{ | ||
"Bridge" : { | ||
"_id" : "bridgeid", | ||
"deviceModel" : "august-connect", | ||
"firmwareVersion" : "2.2.1", | ||
"hyperBridge" : true, | ||
"mfgBridgeID" : "C5WY200WSH", | ||
"operative" : true, | ||
"status" : { | ||
"current" : "online", | ||
"lastOffline" : "2000-00-00T00:00:00.447Z", | ||
"lastOnline" : "2000-00-00T00:00:00.447Z", | ||
"updated" : "2000-00-00T00:00:00.447Z" | ||
} | ||
}, | ||
"Calibrated" : false, | ||
"Created" : "2000-00-00T00:00:00.447Z", | ||
"HouseID" : "123", | ||
"HouseName" : "Test", | ||
"LockID" : "ABC", | ||
"LockName" : "Online door with doorsense", | ||
"LockStatus" : { | ||
"dateTime" : "2000-00-00T00:00:00.447Z", | ||
"doorState" : "open", | ||
"isLockStatusChanged" : false, | ||
"status" : "locked", | ||
"valid" : true | ||
}, | ||
"SerialNumber" : "XY", | ||
"Type" : 1001, | ||
"Updated" : "2000-00-00T00:00:00.447Z", | ||
"battery" : 0.922, | ||
"currentFirmwareVersion" : "undefined-4.3.0-1.8.14", | ||
"homeKitEnabled" : true, | ||
"hostLockInfo" : { | ||
"manufacturer" : "yale", | ||
"productID" : 1536, | ||
"productTypeID" : 32770, | ||
"serialNumber" : "ABC" | ||
}, | ||
"isGalileo" : false, | ||
"macAddress" : "12:22", | ||
"pins" : { | ||
"created" : [], | ||
"loaded" : [] | ||
}, | ||
"skuNumber" : "AUG-MD01", | ||
"supportsEntryCodes" : true, | ||
"timeZone" : "Pacific/Hawaii", | ||
"zWaveEnabled" : false | ||
} |
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