pydiagral 1.5.2__py3-none-any.whl → 1.6.0__py3-none-any.whl

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.
pydiagral/api.py CHANGED
@@ -63,7 +63,7 @@ class DiagralAPI:
63
63
  serial_id: str,
64
64
  apikey: str | None = None,
65
65
  secret_key: str | None = None,
66
- pincode: int | None = None,
66
+ pincode: str | None = None,
67
67
  ) -> None:
68
68
  """Initialize the DiagralAPI instance.
69
69
 
@@ -73,7 +73,7 @@ class DiagralAPI:
73
73
  serial_id (str): The serial ID of the Diagral system.
74
74
  apikey (str | None, optional): The API key for additional authentication. Defaults to None.
75
75
  secret_key (str | None, optional): The secret key for additional authentication. Defaults to None.
76
- pincode (int | None, optional): The PIN code for the Diagral system. Defaults to None.
76
+ pincode (str | None, optional): The PIN code for the Diagral system. Defaults to None.
77
77
 
78
78
  Raises:
79
79
  ConfigurationError: If any required field is empty or invalid.
@@ -104,9 +104,11 @@ class DiagralAPI:
104
104
 
105
105
  # Validate pincode
106
106
  if pincode is not None:
107
- if not isinstance(pincode, int):
108
- raise ConfigurationError("pincode must be an integer")
109
- self.__pincode: int | None = pincode
107
+ if not isinstance(pincode, str) or (
108
+ isinstance(pincode, str) and not pincode.isdigit()
109
+ ):
110
+ raise ConfigurationError("pincode must be an string of digits")
111
+ self.__pincode: str | None = pincode
110
112
 
111
113
  # Initialize session and access_token
112
114
  self.session: aiohttp.ClientSession | None = None
@@ -597,7 +599,7 @@ class DiagralAPI:
597
599
  )
598
600
 
599
601
  _HEADERS: dict[str, str] = {
600
- "X-PIN-CODE": str(self.__pincode),
602
+ "X-PIN-CODE": self.__pincode,
601
603
  "X-HMAC": _HMAC,
602
604
  "X-TIMESTAMP": _TIMESTAMP,
603
605
  "X-APIKEY": self.__apikey,
@@ -640,7 +642,7 @@ class DiagralAPI:
640
642
  )
641
643
 
642
644
  _HEADERS: dict[str, str] = {
643
- "X-PIN-CODE": str(self.__pincode),
645
+ "X-PIN-CODE": self.__pincode,
644
646
  "X-HMAC": _HMAC,
645
647
  "X-TIMESTAMP": _TIMESTAMP,
646
648
  "X-APIKEY": self.__apikey,
@@ -694,7 +696,7 @@ class DiagralAPI:
694
696
  )
695
697
 
696
698
  _HEADERS: dict[str, str] = {
697
- "X-PIN-CODE": str(self.__pincode),
699
+ "X-PIN-CODE": self.__pincode,
698
700
  "X-HMAC": _HMAC,
699
701
  "X-TIMESTAMP": _TIMESTAMP,
700
702
  "X-APIKEY": self.__apikey,
@@ -829,7 +831,7 @@ class DiagralAPI:
829
831
  )
830
832
 
831
833
  _HEADERS: dict[str, str] = {
832
- "X-PIN-CODE": str(self.__pincode),
834
+ "X-PIN-CODE": self.__pincode,
833
835
  "X-HMAC": _HMAC,
834
836
  "X-TIMESTAMP": _TIMESTAMP,
835
837
  "X-APIKEY": self.__apikey,
@@ -936,7 +938,7 @@ class DiagralAPI:
936
938
  )
937
939
 
938
940
  _HEADERS: dict[str, str] = {
939
- "X-PIN-CODE": str(self.__pincode),
941
+ "X-PIN-CODE": self.__pincode,
940
942
  "X-HMAC": _HMAC,
941
943
  "X-TIMESTAMP": _TIMESTAMP,
942
944
  "X-APIKEY": self.__apikey,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydiagral
3
- Version: 1.5.2
3
+ Version: 1.6.0
4
4
  Summary: A Python library for interacting with Diagral systems
5
5
  Project-URL: Homepage, https://github.com/mguyard/pydiagral
6
6
  Project-URL: Documentation, https://github.com/mguyard/pydiagral
@@ -1,10 +1,10 @@
1
1
  pydiagral/__init__.py,sha256=4uM-RD2GQ6JYJkxu-D6wj3XpqfY5gN2hP8NF6WvRI9k,576
2
- pydiagral/api.py,sha256=nEmP1UuZWIMoSpWMxGk4dF2AbejlE7AJHMTBGUeLra8,50129
2
+ pydiagral/api.py,sha256=WVefABeL7ci5glCr5wagTSfhesgj6oFmLCGyJSsqbsg,50199
3
3
  pydiagral/constants.py,sha256=2B0TdKxQHA3cpIBxojo43bMW44wN9xKYsHbBRHWsaBk,119
4
4
  pydiagral/exceptions.py,sha256=vMhGDQW-AhYIH9gcKHK1-4SHV3eZUXeeqXPyznUAKnU,1211
5
5
  pydiagral/models.py,sha256=c9tqZUUEhnjuqRhp5md-iKnQMHk8UsuP3TmH2qFKlPc,54976
6
6
  pydiagral/utils.py,sha256=-VxI-lNaC4bU1K4DSmWDhvbsS2bXv5FAGULGKBf1UMU,449
7
- pydiagral-1.5.2.dist-info/METADATA,sha256=I4FzNyd2r-7cXZXimW1ccCzEg9EulaSLmFghdjQfapY,48529
8
- pydiagral-1.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- pydiagral-1.5.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
- pydiagral-1.5.2.dist-info/RECORD,,
7
+ pydiagral-1.6.0.dist-info/METADATA,sha256=dHm4zLID-f-ZI7BAr5vC3E9dbe4btYScxXbMoZCrzSM,48529
8
+ pydiagral-1.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ pydiagral-1.6.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
+ pydiagral-1.6.0.dist-info/RECORD,,