pydiagral 1.5.0b2__py3-none-any.whl → 1.5.0b4__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
@@ -400,7 +400,7 @@ class DiagralAPI:
400
400
  self.__apikey = None
401
401
  self.__secret_key = None
402
402
 
403
- async def try_connection(self, ephemeral: bool = True) -> bool:
403
+ async def try_connection(self, ephemeral: bool = True) -> TryConnectResult:
404
404
  """Test connection with the Diagral system.
405
405
 
406
406
  This method tests the connection by either using provided API credentials or generating
@@ -489,6 +489,28 @@ class DiagralAPI:
489
489
  )
490
490
  return self.alarm_configuration
491
491
 
492
+ async def get_alarm_name(self) -> str:
493
+ """Get the name of the alarm from the configuration.
494
+
495
+ Returns:
496
+ str: The name of the alarm from the configuration.
497
+
498
+ Raises:
499
+ ConfigurationError: If unable to retrieve the alarm configuration.
500
+
501
+ Note:
502
+ This method will attempt to fetch the configuration if it hasn't been loaded yet.
503
+
504
+ """
505
+
506
+ if not self.alarm_configuration:
507
+ await self.get_configuration()
508
+
509
+ if not self.alarm_configuration:
510
+ raise ConfigurationError("Failed to retrieve alarm configuration")
511
+
512
+ return self.alarm_configuration.alarm.name
513
+
492
514
  async def get_devices_info(self) -> DeviceList:
493
515
  """Asynchronously retrieves information about various device types from the alarm configuration.
494
516
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydiagral
3
- Version: 1.5.0b2
3
+ Version: 1.5.0b4
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=F00LgyVtayPtZOm9O5DNQ2gLCv36vpsK6gCJXxOZNRk,48736
2
+ pydiagral/api.py,sha256=ZshZu5NTSyjK7ozPYrXO6q94yjxnHt3h_boiGzRIUzk,49410
3
3
  pydiagral/constants.py,sha256=2B0TdKxQHA3cpIBxojo43bMW44wN9xKYsHbBRHWsaBk,119
4
4
  pydiagral/exceptions.py,sha256=Q5wEpNtiykLs3Ck0W8r1IQAJek_omaQ3jpMOtiiwBUg,1030
5
5
  pydiagral/models.py,sha256=vUjxuApjVaMtd7H6Iw5LarwABi30O4FfdObhZRbUNuc,54931
6
6
  pydiagral/utils.py,sha256=-VxI-lNaC4bU1K4DSmWDhvbsS2bXv5FAGULGKBf1UMU,449
7
- pydiagral-1.5.0b2.dist-info/METADATA,sha256=ngDa7KSkaHBpcc5EEqf0CS5IlpmQwNF_dvmPDQClfxs,48531
8
- pydiagral-1.5.0b2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- pydiagral-1.5.0b2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
- pydiagral-1.5.0b2.dist-info/RECORD,,
7
+ pydiagral-1.5.0b4.dist-info/METADATA,sha256=qurrNFVqrGxsuLKX9VJKPdtsW8ZhnA2A19rnC1voRPM,48531
8
+ pydiagral-1.5.0b4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ pydiagral-1.5.0b4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
+ pydiagral-1.5.0b4.dist-info/RECORD,,