Skip to main content

The official asynchronous Python client for the Olarm Public API.

Project description

OlarmFlowClient

About Olarm

Olarm is a smart security company that transforms existing alarm systems into connected, app-controlled security solutions. Their products work with major alarm panels (Paradox, DSC, Texecom, IDS, Honeywell and more) to provide remote control, real-time alerts, and comprehensive security management from anywhere.

Python Client

This is the official asynchronous Python client for interacting with the Olarm Public API. For more information about our Olarm Public API, please see our official API documentation on our platform.

Features

  • Fetch your devices information and state
  • Send commands to devices (arm, disarm, stay, sleep, bypass zones, control PGM etc..).
  • Subscribe to real-time state changes and events using MQTT

Quick Start

  1. Sign up at https://login.olarm.com
  2. Go to API section, generate token
  3. pip install olarmflowclient
  4. Copy this code:
import asyncio
from olarmflowclient import OlarmFlowClient

async def main():
    async with OlarmFlowClient("your-token-here") as client:
        devices = await client.get_devices()
        print(f"You have {len(devices['data'])} devices")

# For non-async code:
import asyncio
result = asyncio.run(main())

Please check the examples for more uses!

Examples

The repository includes example scripts that demonstrate how to use the library:

# Run the fetch devices example
python examples/fetch_devices.py --api-token YOUR_API_TOKEN

# Run the fetch devices example
python examples/fetch_device.py --api-token YOUR_API_TOKEN --device-id DEVICE_ID

# Run the MQTT events listener example
python examples/subscribe_device_mqtt.py --api-token YOUR_API_TOKEN --user-id YOUR_USER_ID

NOTE: you can find your User ID in the Olarm user portal

This library provides asynchronous access using aiohttp for API calls and paho-mqtt for real-time event handling via MQTT.

Development

  1. Clone the repository.
  2. Setup venv if necessary
    python3 -m venv venv
    source venv/bin/activate # other shells might be different 
    
  3. Install dependencies:
    pip3 install -r requirements.txt
    
  4. Format code and check for linting errors using Ruff:
    # Check for issues
    python3 -m ruff check .
    
    # Fix issues and format code
    python3 -m ruff check . --fix
    python3 -m ruff format .
    

Running Tests

The project uses pytest and pytest-asyncio for testing. To run the tests:

  1. Make sure you have the testing dependencies installed:

    pip install -r requirements.txt
    
  2. Run the tests with pytest:

    python -m pytest
    

Issues / Feature Requests

Please log issues and feature requests in Github issues 👆

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

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

olarmflowclient-1.0.3.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

olarmflowclient-1.0.3-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file olarmflowclient-1.0.3.tar.gz.

File metadata

  • Download URL: olarmflowclient-1.0.3.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for olarmflowclient-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1bc546ca71c8680173da27f76d99581dba339e91a7197e9d88cedbd9697055dc
MD5 7ccf781a063d9221d6ea5cbca3275c6c
BLAKE2b-256 5d0ad9f5792a7d21821ec2851aaac229a1ffd7b2bcc0d1cf9b4589367cac0157

See more details on using hashes here.

File details

Details for the file olarmflowclient-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for olarmflowclient-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6210eeb9a154a8d965614634e3f1afc1836b26d62f6ad723fe71537262799b33
MD5 d2d412d5cd91ea5fa3226b4ad09af767
BLAKE2b-256 b55fb514580432b788b5c3686e5295d77c972ca542ef096b9d70fe321ec3ec55

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