Add function to get lock/unlock status of a door
This commit is contained in:
parent
7ae175baf0
commit
3787021ffe
@ -52,6 +52,13 @@ def lockOrUnlockDoor(targetIP, lock=True):
|
|||||||
"command": "lockDoor" if lock else "unlockDoor"}))
|
"command": "lockDoor" if lock else "unlockDoor"}))
|
||||||
return doXMLRequest(targetIP, el)
|
return doXMLRequest(targetIP, el)
|
||||||
|
|
||||||
|
def getStatus(targetIP):
|
||||||
|
el = E_plain.VertXMessage(
|
||||||
|
E.Doors({"action": "LR", "responseFormat": "status"}))
|
||||||
|
xml = doXMLRequest(targetIP, el)
|
||||||
|
relayState = xml.find('./{*}Doors/{*}Door').attrib['relayState']
|
||||||
|
return "unlocked" if relayState == "set" else "locked"
|
||||||
|
|
||||||
def forEachDoor(fxn):
|
def forEachDoor(fxn):
|
||||||
for doorName, doorData in config["doors"].items():
|
for doorName, doorData in config["doors"].items():
|
||||||
print(doorName)
|
print(doorName)
|
||||||
|
Reference in New Issue
Block a user