mirror of
https://github.com/cheveguerra/TotalConnect.git
synced 2026-08-19 00:46:37 +00:00
Initial commit: Hybrid polling, interactive log modal and 3-second hard reset
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
import json
|
||||
from total_connect_client.client import TotalConnectClient
|
||||
from total_connect_client.const import make_http_endpoint
|
||||
|
||||
creds = json.load(open('credentials.json', encoding='utf-8'))['accounts'][0]
|
||||
client = TotalConnectClient(creds['username'], creds['password'], load_details=False)
|
||||
client.authenticate()
|
||||
|
||||
location_id = 1417027
|
||||
endpoint = make_http_endpoint(f"api/v3/locations/{location_id}/partitions/fullStatus")
|
||||
res = client.http_request(endpoint=endpoint, method="GET")
|
||||
|
||||
print("Keys at root of fullStatus response:")
|
||||
print(list(res.keys()))
|
||||
|
||||
print("\nValue of ArmingState at root:")
|
||||
print(res.get("ArmingState"))
|
||||
|
||||
print("\nValue of PanelStatus -> ArmingState:")
|
||||
panel_status = res.get("PanelStatus", {})
|
||||
print(panel_status.get("ArmingState"))
|
||||
|
||||
print("\nPartitions data:")
|
||||
for p in panel_status.get("Partitions", []):
|
||||
print(f" PartitionID={p.get('PartitionID')}, ArmingState={p.get('ArmingState')}")
|
||||
Reference in New Issue
Block a user