pyhyypapihawkmod 1.0.1.dev1__tar.gz → 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyhyypapihawkmod-1.0.1.dev1/pyhyypapihawkmod.egg-info → pyhyypapihawkmod-1.0.3}/PKG-INFO +1 -1
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/README.md +19 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/alarm_info.py +21 -1
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/client.py +50 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3/pyhyypapihawkmod.egg-info}/PKG-INFO +1 -1
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/setup.py +1 -1
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/LICENSE.md +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/MANIFEST.in +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/__init__.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/__main__.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/android_checkin_pb2.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/checkin_pb2.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/constants.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/exceptions.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/mcs_pb2.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/push_receiver.py +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod.egg-info/SOURCES.txt +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod.egg-info/dependency_links.txt +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod.egg-info/requires.txt +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod.egg-info/top_level.txt +0 -0
- {pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/setup.cfg +0 -0
|
@@ -3,6 +3,7 @@ This is a fork from https://github.com/RenierM26. This fork has reversed enginee
|
|
|
3
3
|
# pyHyypApi
|
|
4
4
|
API for ADT Secure Home and IDS Hyyp. There could be more variants but it's easy to add package names to the constants.py file.
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
How to use:
|
|
7
8
|
|
|
8
9
|
1. Install:
|
|
@@ -44,3 +45,21 @@ TO Do:
|
|
|
44
45
|
- CLI usage. (GCF client is there, just needs some more automation.)
|
|
45
46
|
- Capture panic api...for obvious reasons.
|
|
46
47
|
- What zone caused arm/arm stay not to work. - Looks like GCM/Firebase push messages. Added GCM client...just run main program and register GCF code in function called register gcf. It works.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
Changelog
|
|
51
|
+
|
|
52
|
+
1.0.3
|
|
53
|
+
- Fixed a bug where stay profiles would mostly go to false even though stay profiles were armed.
|
|
54
|
+
|
|
55
|
+
1.0.2
|
|
56
|
+
- Fixed a bug where the parameters for certain items were swapped
|
|
57
|
+
|
|
58
|
+
1.0.1
|
|
59
|
+
|
|
60
|
+
- Added fix where setups with multiple sites would crash
|
|
61
|
+
- Added the ability to find "automations" and also trigger the automations
|
|
62
|
+
|
|
63
|
+
1.0.0
|
|
64
|
+
|
|
65
|
+
Bumped main release to 1.0.0
|
|
@@ -60,7 +60,11 @@ class HyypAlarmInfos:
|
|
|
60
60
|
partition_ids = {
|
|
61
61
|
partition["id"]: partition for partition in self._sync_info["partitions"]
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
trigger_ids = {
|
|
65
|
+
trigger["id"]: trigger for trigger in self._sync_info["triggers"]
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
for site in site_ids:
|
|
65
69
|
|
|
66
70
|
# Add last site notification.
|
|
@@ -68,6 +72,17 @@ class HyypAlarmInfos:
|
|
|
68
72
|
site_ids[site]["lastNoticeTime"] = _last_notice["lastNoticeTime"]
|
|
69
73
|
site_ids[site]["lastNoticeName"] = _last_notice["lastNoticeName"]
|
|
70
74
|
|
|
75
|
+
# Add triggers (PGM / Automations in APP)
|
|
76
|
+
for trigger_id in trigger_ids:
|
|
77
|
+
if trigger_id not in site_ids[site]["triggerIds"]:
|
|
78
|
+
continue
|
|
79
|
+
else:
|
|
80
|
+
site_ids[site]["triggers"] = {
|
|
81
|
+
key: value
|
|
82
|
+
for (key, value) in trigger_ids.items()
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
71
86
|
# Add partition info.
|
|
72
87
|
site_ids[site]["partitions"] = {
|
|
73
88
|
partition_id: partition_ids[partition_id]
|
|
@@ -104,9 +119,14 @@ class HyypAlarmInfos:
|
|
|
104
119
|
)
|
|
105
120
|
|
|
106
121
|
# Add partition stay_armed status.
|
|
122
|
+
site_ids[site]["partitions"][partition]["stayArmed"] = False
|
|
123
|
+
|
|
107
124
|
for stay_profile in site_ids[site]["partitions"][partition][
|
|
108
125
|
"stayProfiles"
|
|
109
126
|
]:
|
|
127
|
+
if stay_profile not in self._state_info["armedStayProfileIds"]:
|
|
128
|
+
continue
|
|
129
|
+
|
|
110
130
|
site_ids[site]["partitions"][partition]["stayArmed"] = bool(
|
|
111
131
|
stay_profile in self._state_info["armedStayProfileIds"]
|
|
112
132
|
)
|
|
@@ -29,6 +29,7 @@ API_ENDPOINT_SET_ZONE_BYPASS = "/device/bypass"
|
|
|
29
29
|
API_ENDPOINT_GET_CAMERA_BY_PARTITION = "/device/getCameraByPartition"
|
|
30
30
|
API_ENDPOINT_UPDATE_SUB_USER = "/user/updateSubUser"
|
|
31
31
|
API_ENDPOINT_SET_NOTIFICATION_SUBSCRIPTIONS = "/user/setNotificationSubscriptionsNew"
|
|
32
|
+
API_ENDPOINT_TRIGGER_AUTOMATION = "/device/trigger"
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
class HyypClient:
|
|
@@ -746,6 +747,55 @@ class HyypClient:
|
|
|
746
747
|
|
|
747
748
|
return _json_result
|
|
748
749
|
|
|
750
|
+
|
|
751
|
+
def trigger_automation(
|
|
752
|
+
self,
|
|
753
|
+
site_id: int,
|
|
754
|
+
trigger_id: int | None = None,
|
|
755
|
+
pin: int | None = None,
|
|
756
|
+
) -> Any:
|
|
757
|
+
"""Trigger Alarm via API."""
|
|
758
|
+
|
|
759
|
+
_params: dict[Any, Any] = STD_PARAMS.copy()
|
|
760
|
+
_params["pin"] = pin
|
|
761
|
+
_params["siteId"] = site_id
|
|
762
|
+
_params["triggerId"] = trigger_id
|
|
763
|
+
del _params["imei"]
|
|
764
|
+
_params["clientImei"] = STD_PARAMS["imei"]
|
|
765
|
+
|
|
766
|
+
try:
|
|
767
|
+
req = self._session.post(
|
|
768
|
+
"https://" + BASE_URL + API_ENDPOINT_TRIGGER_AUTOMATION,
|
|
769
|
+
allow_redirects=False,
|
|
770
|
+
params=_params,
|
|
771
|
+
timeout=self._timeout,
|
|
772
|
+
)
|
|
773
|
+
|
|
774
|
+
req.raise_for_status()
|
|
775
|
+
|
|
776
|
+
except requests.ConnectionError as err:
|
|
777
|
+
raise InvalidURL("A Invalid URL or Proxy error occured") from err
|
|
778
|
+
|
|
779
|
+
except requests.HTTPError as err:
|
|
780
|
+
raise HTTPError from err
|
|
781
|
+
|
|
782
|
+
try:
|
|
783
|
+
_json_result: dict[Any, Any] = req.json()
|
|
784
|
+
|
|
785
|
+
except ValueError as err:
|
|
786
|
+
raise HyypApiError(
|
|
787
|
+
"Impossible to decode response: "
|
|
788
|
+
+ str(err)
|
|
789
|
+
+ "\nResponse was: "
|
|
790
|
+
+ str(req.text)
|
|
791
|
+
) from err
|
|
792
|
+
|
|
793
|
+
if _json_result["status"] != "SUCCESS" and _json_result["error"] is not None:
|
|
794
|
+
raise HyypApiError(f"Trigger automation failed: {_json_result['error']}")
|
|
795
|
+
|
|
796
|
+
return _json_result
|
|
797
|
+
|
|
798
|
+
|
|
749
799
|
def set_zone_bypass(
|
|
750
800
|
self,
|
|
751
801
|
zones: int,
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name='pyhyypapihawkmod',
|
|
8
|
-
version="1.0.
|
|
8
|
+
version="1.0.3",
|
|
9
9
|
license='Apache Software License 2.0',
|
|
10
10
|
author='hawky358 (Original code by Renier Moorcroft)',
|
|
11
11
|
author_email='hawky358@users.github.com',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod/android_checkin_pb2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod.egg-info/requires.txt
RENAMED
|
File without changes
|
{pyhyypapihawkmod-1.0.1.dev1 → pyhyypapihawkmod-1.0.3}/pyhyypapihawkmod.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|