Skip to main content

A Python library for interacting with Diagral systems

Project description

A powerful and easy-to-use Python library for seamless integration with the Diagral alarm system.

license last-commit repo-top-language repo-language-count

Last Release Last Release Date Python Lint Action Release & Doc Action



pydiagral

Welcome to the documentation for pydiagral, a Python library for interacting with the Diagral API.

📍 About pydiagral

pydiagral is an asynchronous Python interface for the Diagral alarm system. This library allows users to control and monitor their Diagral alarm system through the official API.

[!CAUTION]

Please note that the Diagral alarm system is a security system, and it may be preferable not to connect it to any automation platform for security reasons. In no event shall the developer of pydiagral library be held liable for any issues arising from the use of this pydiagral library. The user installs and uses this integration at their own risk and with full knowledge of the potential implications.

✅ Requirement

To use this library, which leverages the Diagral APIs, you must have a Diagral box (DIAG56AAX). This box connects your Diagral alarm system to the internet, enabling interaction with the alarm system via the API. You can find more information about the Diagral box here.

📦 Key Features

The DiagralAPI class offers the following functionalities:

  • Authentication:

    • Connect to the Diagral API with username and password
    • Manage access tokens and their expiration
    • Create, validate, and delete API keys
  • System Configuration:

    • Retrieve alarm configuration
  • System Information:

    • Obtain system details
    • Retrieve the current system status
    • Manage webhooks
    • Manage anomalies
  • System Interraction:

    • Activate or Desactivate system (partially or globally)
    • Automatism actions

🚀 Quick Start

To get started with pydiagral, follow these steps:

  1. Installation:

    pip install pydiagral
    
  2. Example

A modular and easy-to-use test script is available example_code.py to help you get started with the library.

Simply create a .env file with the following content:

USERNAME=your_email@example.com
PASSWORD=your_password
SERIAL_ID=your_serial_id
PIN_CODE=your_pin_code
LOG_LEVEL=DEBUG

And run the example_code.py.

[!TIP]

You can customize the actions performed by example_code.py by modifying the parameters in the code, as indicated by the CUSTOMIZE THE TESTS section title.

📖 Documentations

Package Documentation

Library documentation is available here.

Package Structure

For detailed library documentation, please refer to the following sections:

  • API Reference: Comprehensive documentation of the DiagralAPI class and its methods
  • Data Models: Description of the data structures used
  • Exceptions: List of package exceptions

Diagral API Official documentation

Official Diagral API is available here.

🙋 FAQ

How to find Serial on DIAG56AAX

The serial number can only be found with physical access to the box. You need to open it, and you will find a label with a QR Code.

On this label, there is a 15-character code that represents the serial number of the box.

How to find your Diagral Serial

[!IMPORTANT]

This code is necessary to use this library and Diagral API.

🤝 Contribution

Contributions are welcome! Here are several ways you can contribute:

  • Submit Pull Requests: Review open PRs, and submit your own PRs.
  • Report Issues: Submit bugs found or log feature requests.
Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your GitHub account.
  2. Clone Locally: Clone the forked repository to your local machine using a Git client.
    git clone https://github.com/mguyard/pydiagral
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit your changes with a clear and concise message that follows the Conventional Commits guidelines.
    git commit -m 'feat: Implemented new feature x.'
    
  6. Push to GitHub: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.

Once your PR is reviewed and approved, it will be merged into the beta branch. After final testing, it will be merged into the main branch.

📄 License

pydiagral is distributed under the GPL-v3 License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydiagral-1.5.0b6.tar.gz (342.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydiagral-1.5.0b6-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file pydiagral-1.5.0b6.tar.gz.

File metadata

  • Download URL: pydiagral-1.5.0b6.tar.gz
  • Upload date:
  • Size: 342.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for pydiagral-1.5.0b6.tar.gz
Algorithm Hash digest
SHA256 9e845566a530f5b939c98a8efa03b089a75c04df8e6d5f97e7af4438c7afc76b
MD5 881fcfc2cec857b5385e9c028fcb8d7c
BLAKE2b-256 f5a3bfa6654a04f6c74214445a0413836a1ddf6e868caaec1cc6dbee2f6e5791

See more details on using hashes here.

File details

Details for the file pydiagral-1.5.0b6-py3-none-any.whl.

File metadata

  • Download URL: pydiagral-1.5.0b6-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for pydiagral-1.5.0b6-py3-none-any.whl
Algorithm Hash digest
SHA256 cebee6b463a260f4b1223358d5ed094f2d3d4e8f713414c71712a23034ebf3b6
MD5 1550b34c5f381d9dcff3cff98a6238ab
BLAKE2b-256 7b9cfeec89cf8edcff9677ab3f7b694f5b0e6105cf814002f00fdbdd60f9476e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page