pyGuardPoint 2.0.6__tar.gz → 2.0.8__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.
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/PKG-INFO +1 -1
- pyguardpoint-2.0.8/pyGuardPoint/_guardpoint_weeklyprograms.py +67 -0
- pyguardpoint-2.0.8/pyGuardPoint/gp_asyncio/_async_guardpoint_weeklyprograms.py +67 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/guardpoint.py +2 -1
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/guardpoint_asyncio.py +2 -1
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/guardpoint_dataclasses.py +42 -3
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/guardpoint_utils.py +5 -2
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint.egg-info/PKG-INFO +1 -1
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint.egg-info/SOURCES.txt +2 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/setup.py +1 -1
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/LICENSE.txt +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/README.rst +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/CustomWebsocketTransport.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/CustomWebsocketTransportOld.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/__init__.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_accessgroups.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_alarmstates.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_alarmzones.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_areas.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_cardholders.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_cardholdertypes.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_cards.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_controllers.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_customizedfields.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_departments.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_diagnostic.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_events.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_genericinformation.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_inputs.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_manualevents.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_ouputs.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_personaldetails.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_readers.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_scheduledmags.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_securitygroups.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_guardpoint_sites.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_odata_filter.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/_str_match_algo.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/__init__.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_accessgroups.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_alarmstates.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_alarmzones.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_areas.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_cardholders.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_cardholdertypes.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_cards.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_controllers.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_customizedfields.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_departments.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_diagnostic.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_events.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_genericinformation.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_manualevents.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_ouputs.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_personaldetails.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_readers.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_scheduledmags.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_securitygroups.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_sites.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/guardpoint_connection_asyncio.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/guardpoint_connection.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/guardpoint_error.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/guardpoint_threaded.py +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint.egg-info/dependency_links.txt +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint.egg-info/not-zip-safe +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint.egg-info/requires.txt +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint.egg-info/top_level.txt +0 -0
- {pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/setup.cfg +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
from .guardpoint_dataclasses import WeeklyProgram
|
|
3
|
+
from .guardpoint_utils import GuardPointResponse
|
|
4
|
+
from .guardpoint_error import GuardPointError, GuardPointUnauthorized
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class WeeklyProgramsAPI:
|
|
8
|
+
|
|
9
|
+
def get_weekly_program(self, weekly_program_uid):
|
|
10
|
+
url = self.baseurl + "/odata/API_WeeklyPrograms"
|
|
11
|
+
url_query_params = f"({weekly_program_uid})"
|
|
12
|
+
headers = {
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
'Accept': 'application/json',
|
|
15
|
+
}
|
|
16
|
+
code, json_body = self.gp_json_query("GET", headers=headers, url=(url + url_query_params))
|
|
17
|
+
|
|
18
|
+
if code != 200:
|
|
19
|
+
error_msg = GuardPointResponse.extract_error_msg(json_body)
|
|
20
|
+
|
|
21
|
+
if code == 401:
|
|
22
|
+
raise GuardPointUnauthorized(f"Unauthorized - ({error_msg})")
|
|
23
|
+
elif code == 404: # Not Found
|
|
24
|
+
return None
|
|
25
|
+
else:
|
|
26
|
+
raise GuardPointError(f"{error_msg}")
|
|
27
|
+
|
|
28
|
+
# Check response body is formatted as expected
|
|
29
|
+
if not isinstance(json_body, dict):
|
|
30
|
+
raise GuardPointError("Badly formatted response.")
|
|
31
|
+
if 'value' not in json_body:
|
|
32
|
+
raise GuardPointError("Badly formatted response.")
|
|
33
|
+
if not isinstance(json_body['value'], list):
|
|
34
|
+
raise GuardPointError("Badly formatted response.")
|
|
35
|
+
|
|
36
|
+
return WeeklyProgram(json_body['value'][0])
|
|
37
|
+
|
|
38
|
+
def get_weekly_programs(self):
|
|
39
|
+
url = self.baseurl + "/odata/API_WeeklyPrograms"
|
|
40
|
+
|
|
41
|
+
code, json_body = self.gp_json_query("GET", url=url)
|
|
42
|
+
|
|
43
|
+
if code != 200:
|
|
44
|
+
error_msg = GuardPointResponse.extract_error_msg(json_body)
|
|
45
|
+
|
|
46
|
+
if code == 401:
|
|
47
|
+
raise GuardPointUnauthorized(f"Unauthorized - ({error_msg})")
|
|
48
|
+
elif code == 404: # Not Found
|
|
49
|
+
raise GuardPointError(f"No WeeklyPrograms Found")
|
|
50
|
+
else:
|
|
51
|
+
raise GuardPointError(f"{error_msg}")
|
|
52
|
+
|
|
53
|
+
# Check response body is formatted as expected
|
|
54
|
+
if not isinstance(json_body, dict):
|
|
55
|
+
raise GuardPointError("Badly formatted response.")
|
|
56
|
+
if 'value' not in json_body:
|
|
57
|
+
raise GuardPointError("Badly formatted response.")
|
|
58
|
+
if not isinstance(json_body['value'], list):
|
|
59
|
+
raise GuardPointError("Badly formatted response.")
|
|
60
|
+
|
|
61
|
+
# Compose list of inputs
|
|
62
|
+
weekly_programs = []
|
|
63
|
+
for entry in json_body['value']:
|
|
64
|
+
if isinstance(entry, dict):
|
|
65
|
+
wp = WeeklyProgram(entry)
|
|
66
|
+
weekly_programs.append(wp)
|
|
67
|
+
return weekly_programs
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
from ..guardpoint_dataclasses import WeeklyProgram
|
|
3
|
+
from ..guardpoint_utils import GuardPointResponse
|
|
4
|
+
from ..guardpoint_error import GuardPointError, GuardPointUnauthorized
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class WeeklyProgramsAPI:
|
|
8
|
+
|
|
9
|
+
async def get_weekly_program(self, weekly_program_uid):
|
|
10
|
+
url = "/odata/API_WeeklyPrograms"
|
|
11
|
+
url_query_params = f"({weekly_program_uid})"
|
|
12
|
+
headers = {
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
'Accept': 'application/json',
|
|
15
|
+
}
|
|
16
|
+
code, json_body = await self.gp_json_query("GET", headers=headers, url=(url + url_query_params))
|
|
17
|
+
|
|
18
|
+
if code != 200:
|
|
19
|
+
error_msg = GuardPointResponse.extract_error_msg(json_body)
|
|
20
|
+
|
|
21
|
+
if code == 401:
|
|
22
|
+
raise GuardPointUnauthorized(f"Unauthorized - ({error_msg})")
|
|
23
|
+
elif code == 404: # Not Found
|
|
24
|
+
return None
|
|
25
|
+
else:
|
|
26
|
+
raise GuardPointError(f"{error_msg}")
|
|
27
|
+
|
|
28
|
+
# Check response body is formatted as expected
|
|
29
|
+
if not isinstance(json_body, dict):
|
|
30
|
+
raise GuardPointError("Badly formatted response.")
|
|
31
|
+
if 'value' not in json_body:
|
|
32
|
+
raise GuardPointError("Badly formatted response.")
|
|
33
|
+
if not isinstance(json_body['value'], list):
|
|
34
|
+
raise GuardPointError("Badly formatted response.")
|
|
35
|
+
|
|
36
|
+
return WeeklyProgram(json_body['value'][0])
|
|
37
|
+
|
|
38
|
+
async def get_weekly_programs(self):
|
|
39
|
+
url = "/odata/API_WeeklyPrograms"
|
|
40
|
+
|
|
41
|
+
code, json_body = await self.gp_json_query("GET", url=url)
|
|
42
|
+
|
|
43
|
+
if code != 200:
|
|
44
|
+
error_msg = GuardPointResponse.extract_error_msg(json_body)
|
|
45
|
+
|
|
46
|
+
if code == 401:
|
|
47
|
+
raise GuardPointUnauthorized(f"Unauthorized - ({error_msg})")
|
|
48
|
+
elif code == 404: # Not Found
|
|
49
|
+
raise GuardPointError(f"No WeeklyPrograms Found")
|
|
50
|
+
else:
|
|
51
|
+
raise GuardPointError(f"{error_msg}")
|
|
52
|
+
|
|
53
|
+
# Check response body is formatted as expected
|
|
54
|
+
if not isinstance(json_body, dict):
|
|
55
|
+
raise GuardPointError("Badly formatted response.")
|
|
56
|
+
if 'value' not in json_body:
|
|
57
|
+
raise GuardPointError("Badly formatted response.")
|
|
58
|
+
if not isinstance(json_body['value'], list):
|
|
59
|
+
raise GuardPointError("Badly formatted response.")
|
|
60
|
+
|
|
61
|
+
# Compose list of inputs
|
|
62
|
+
weekly_programs = []
|
|
63
|
+
for entry in json_body['value']:
|
|
64
|
+
if isinstance(entry, dict):
|
|
65
|
+
wp = WeeklyProgram(entry)
|
|
66
|
+
weekly_programs.append(wp)
|
|
67
|
+
return weekly_programs
|
|
@@ -6,6 +6,7 @@ from pysignalr.client import SignalRClient
|
|
|
6
6
|
|
|
7
7
|
from .CustomWebsocketTransport import CustomWebsocketTransport, DEFAULT_PING_INTERVAL, DEFAULT_CONNECTION_TIMEOUT, \
|
|
8
8
|
DEFAULT_MAX_SIZE
|
|
9
|
+
from ._guardpoint_weeklyprograms import WeeklyProgramsAPI
|
|
9
10
|
from ._guardpoint_alarmstates import AlarmStatesAPI
|
|
10
11
|
from ._guardpoint_alarmzones import AlarmZonesAPI
|
|
11
12
|
from ._guardpoint_cardholdertypes import CardholderTypesAPI
|
|
@@ -44,7 +45,7 @@ def stop_listening(client: SignalRClient):
|
|
|
44
45
|
class GuardPoint(GuardPointConnection, CardsAPI, CardholdersAPI, AreasAPI, SecurityGroupsAPI, CustomizedFieldsAPI,
|
|
45
46
|
PersonalDetailsAPI, ScheduledMagsAPI, CardholderTypesAPI, OutputsAPI, DiagnosticAPI, ReadersAPI,
|
|
46
47
|
ControllersAPI, AlarmStatesAPI, EventsAPI, DepartmentsAPI, SitesAPI, AccessGroupsAPI, GenericInfoAPI,
|
|
47
|
-
AlarmZonesAPI, InputsAPI, ManualEventsAPI):
|
|
48
|
+
AlarmZonesAPI, InputsAPI, ManualEventsAPI, WeeklyProgramsAPI):
|
|
48
49
|
"""
|
|
49
50
|
A class to interface with the GuardPoint system, providing various APIs for managing cards, cardholders, areas,
|
|
50
51
|
security groups, customized fields, personal details, scheduled mags, cardholder types, outputs, diagnostics,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import logging
|
|
3
3
|
import validators
|
|
4
4
|
|
|
5
|
+
from .gp_asyncio._async_guardpoint_weeklyprograms import WeeklyProgramsAPI
|
|
5
6
|
from .gp_asyncio._async_guardpoint_accessgroups import AccessGroupsAPI
|
|
6
7
|
from .gp_asyncio._async_guardpoint_manualevents import ManualEventsAPI
|
|
7
8
|
from .gp_asyncio._async_guardpoint_alarmzones import AlarmZonesAPI
|
|
@@ -34,7 +35,7 @@ class GuardPointAsyncIO(GuardPointConnection, CardsAPI, CardholdersAPI, AreasAPI
|
|
|
34
35
|
CustomizedFieldsAPI, PersonalDetailsAPI, ScheduledMagsAPI, CardholderTypesAPI,
|
|
35
36
|
OutputsAPI, DiagnosticAPI, ReadersAPI, ControllersAPI, AlarmStatesAPI, EventsAPI,
|
|
36
37
|
DepartmentsAPI, SitesAPI, GenericInfoAPI, AlarmZonesAPI, ManualEventsAPI,
|
|
37
|
-
AccessGroupsAPI):
|
|
38
|
+
AccessGroupsAPI, WeeklyProgramsAPI):
|
|
38
39
|
"""
|
|
39
40
|
Asynchronous interface for interacting with the GuardPoint system, providing various APIs for managing cards,
|
|
40
41
|
cardholders, areas, security groups, customized fields, personal details, scheduled mags, cardholder types,
|
|
@@ -62,6 +62,7 @@ class CardholderOrderBy(Enum):
|
|
|
62
62
|
fromDateValid_DESC = 0,
|
|
63
63
|
lastPassDate_DESC = 1
|
|
64
64
|
|
|
65
|
+
|
|
65
66
|
@dataclass
|
|
66
67
|
class CustomizedField:
|
|
67
68
|
customizedFieldType: str = ""
|
|
@@ -97,6 +98,32 @@ class CustomizedField:
|
|
|
97
98
|
else:
|
|
98
99
|
cf_dict[k] = str(v)
|
|
99
100
|
|
|
101
|
+
@dataclass
|
|
102
|
+
class WeeklyProgram:
|
|
103
|
+
uid: str = ""
|
|
104
|
+
name: str = ""
|
|
105
|
+
apiKey: any = None
|
|
106
|
+
description: any = None
|
|
107
|
+
|
|
108
|
+
def __init__(self, *args, **kwargs):
|
|
109
|
+
super().__init__()
|
|
110
|
+
me_dict = sanitise_args(self, args, kwargs)
|
|
111
|
+
|
|
112
|
+
for property_name in me_dict:
|
|
113
|
+
if isinstance(me_dict[property_name], (str, type(None), bool, int, dict)):
|
|
114
|
+
setattr(self, property_name, me_dict[property_name])
|
|
115
|
+
|
|
116
|
+
def dict(self):
|
|
117
|
+
me_dict = {}
|
|
118
|
+
for k, v in asdict(self).items():
|
|
119
|
+
if isinstance(v, (list, dict, bool, int)):
|
|
120
|
+
me_dict[k] = v
|
|
121
|
+
elif isinstance(v, type(None)):
|
|
122
|
+
me_dict[k] = None
|
|
123
|
+
else:
|
|
124
|
+
me_dict[k] = str(v)
|
|
125
|
+
|
|
126
|
+
|
|
100
127
|
@dataclass
|
|
101
128
|
class ManualEvent:
|
|
102
129
|
uid: str = ""
|
|
@@ -515,7 +542,7 @@ class AccessEvent:
|
|
|
515
542
|
accessDeniedCode: str = ""
|
|
516
543
|
cardCode: str = ""
|
|
517
544
|
cardholderFirstName: any = None
|
|
518
|
-
cardholderIdNumber:
|
|
545
|
+
cardholderIdNumber: str = None
|
|
519
546
|
cardholderLastName: any = None
|
|
520
547
|
cardholderTypeName: any = None
|
|
521
548
|
cardholderTypeUID: any = None
|
|
@@ -1105,7 +1132,7 @@ class Cardholder(Observable):
|
|
|
1105
1132
|
uid: str = ""
|
|
1106
1133
|
lastName: str = ""
|
|
1107
1134
|
firstName: str = ""
|
|
1108
|
-
cardholderIdNumber:
|
|
1135
|
+
cardholderIdNumber: str = ""
|
|
1109
1136
|
status: any = None
|
|
1110
1137
|
fromDateValid: any = None
|
|
1111
1138
|
isFromDateActive: any = None
|
|
@@ -1134,6 +1161,7 @@ class Cardholder(Observable):
|
|
|
1134
1161
|
securityGroupUID: str = ""
|
|
1135
1162
|
accessGroupUIDs: any = None
|
|
1136
1163
|
liftAccessGroupUIDs: any = None
|
|
1164
|
+
personalCrisisLevel: int = 0
|
|
1137
1165
|
lastDownloadTime: any = None
|
|
1138
1166
|
lastInOutArea: str = ""
|
|
1139
1167
|
lastInOutReaderUID: any = None
|
|
@@ -1144,6 +1172,8 @@ class Cardholder(Observable):
|
|
|
1144
1172
|
lastReaderPassUID: any = None
|
|
1145
1173
|
insideAreaUID: str = ""
|
|
1146
1174
|
cards: list = None
|
|
1175
|
+
#resetAPBLevelWhenDownload: bool = False
|
|
1176
|
+
noAntiPassback: bool = False
|
|
1147
1177
|
|
|
1148
1178
|
def __init__(self, *args, **kwargs):
|
|
1149
1179
|
super().__init__()
|
|
@@ -1184,7 +1214,16 @@ class Cardholder(Observable):
|
|
|
1184
1214
|
self.cardholderCustomizedField = CardholderCustomizedField(cardholder_dict[property_name])
|
|
1185
1215
|
|
|
1186
1216
|
if isinstance(cardholder_dict[property_name], (str, type(None), bool, int)):
|
|
1187
|
-
|
|
1217
|
+
value = cardholder_dict[property_name]
|
|
1218
|
+
|
|
1219
|
+
try:
|
|
1220
|
+
if isinstance(getattr(self, property_name), str):
|
|
1221
|
+
value = str(value)
|
|
1222
|
+
except:
|
|
1223
|
+
pass
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
setattr(self, property_name, value)
|
|
1188
1227
|
|
|
1189
1228
|
# Monitor Changes
|
|
1190
1229
|
for k, v in asdict(self).items():
|
|
@@ -47,8 +47,11 @@ class GuardPointResponse:
|
|
|
47
47
|
if isinstance(response_body, dict):
|
|
48
48
|
if "errorMessages" in response_body:
|
|
49
49
|
if isinstance(response_body["errorMessages"], list):
|
|
50
|
-
if
|
|
51
|
-
|
|
50
|
+
if len(response_body["errorMessages"]) > 0:
|
|
51
|
+
if 'message' in response_body["errorMessages"][0] and 'other' in response_body["errorMessages"][0]:
|
|
52
|
+
error_msg = f'{response_body["errorMessages"][0]["message"]}-{response_body["errorMessages"][0]["other"]}'
|
|
53
|
+
elif isinstance(response_body["errorMessages"][0], str):
|
|
54
|
+
error_msg = response_body["errorMessages"][0]
|
|
52
55
|
if 'message' in response_body:
|
|
53
56
|
error_msg = response_body['message']
|
|
54
57
|
if 'error' in response_body:
|
|
@@ -25,6 +25,7 @@ pyGuardPoint/_guardpoint_readers.py
|
|
|
25
25
|
pyGuardPoint/_guardpoint_scheduledmags.py
|
|
26
26
|
pyGuardPoint/_guardpoint_securitygroups.py
|
|
27
27
|
pyGuardPoint/_guardpoint_sites.py
|
|
28
|
+
pyGuardPoint/_guardpoint_weeklyprograms.py
|
|
28
29
|
pyGuardPoint/_odata_filter.py
|
|
29
30
|
pyGuardPoint/_str_match_algo.py
|
|
30
31
|
pyGuardPoint/guardpoint.py
|
|
@@ -61,4 +62,5 @@ pyGuardPoint/gp_asyncio/_async_guardpoint_readers.py
|
|
|
61
62
|
pyGuardPoint/gp_asyncio/_async_guardpoint_scheduledmags.py
|
|
62
63
|
pyGuardPoint/gp_asyncio/_async_guardpoint_securitygroups.py
|
|
63
64
|
pyGuardPoint/gp_asyncio/_async_guardpoint_sites.py
|
|
65
|
+
pyGuardPoint/gp_asyncio/_async_guardpoint_weeklyprograms.py
|
|
64
66
|
pyGuardPoint/gp_asyncio/guardpoint_connection_asyncio.py
|
|
@@ -5,7 +5,7 @@ long_description = open('README.rst').read()
|
|
|
5
5
|
setup(name="pyGuardPoint",
|
|
6
6
|
python_requires='>3.9.0',
|
|
7
7
|
packages=find_packages(),
|
|
8
|
-
version="2.0.
|
|
8
|
+
version="2.0.8",
|
|
9
9
|
author="John Owen",
|
|
10
10
|
description="Python wrapper for GuardPoint 10 Access Control System",
|
|
11
11
|
long_description_content_type='text/markdown',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_accessgroups.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_alarmstates.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_alarmzones.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_areas.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_cardholders.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_cards.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_controllers.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_departments.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_diagnostic.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_events.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_manualevents.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_ouputs.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_readers.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_scheduledmags.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/_async_guardpoint_sites.py
RENAMED
|
File without changes
|
{pyguardpoint-2.0.6 → pyguardpoint-2.0.8}/pyGuardPoint/gp_asyncio/guardpoint_connection_asyncio.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|