Skip to main content

A Python library for interacting with the Sector Alarm API.

Project description

SectorAlarm Library

A Python client library for interacting with Sector Alarm systems.

Overview

The sectoralarm library allows developers to interact with Sector Alarm systems programmatically. It provides methods to authenticate, retrieve system status, control locks, arm/disarm the alarm system, and access sensor data.

Features

  • Authentication: Securely log in to the Sector Alarm API.
  • System Status: Retrieve panel status and sensor data.
  • Control Actions: Arm/disarm the alarm system and lock/unlock doors.
  • Logs Access: Access system logs and events.
  • Cache Management: Efficiently cache data to minimize API calls.

Installation

You can install the library via pip:

pip install sectoralarm

Usage

Importing the Library

from sectoralarm import SectorAlarmAPI, AuthenticationError

Initializing the API Client

# Replace with your actual credentials
email = "your_email@example.com"
password = "your_password"
panel_id = "your_panel_id"
panel_code = "your_panel_code"

api = SectorAlarmAPI(email, password, panel_id, panel_code)

Logging In

try:
    api.login()
    print("Logged in successfully.")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")

Retrieving Panel Status

status = api.retrieve_category_data("Panel Status")
print("Panel Status:")
print(status)

Arming the System

success = api.actions_manager.arm_system()
if success:
    print("System armed successfully.")
else:
    print("Failed to arm the system.")

Disarming the System

success = api.actions_manager.disarm_system()
if success:
    print("System disarmed successfully.")
else:
    print("Failed to disarm the system.")

Locking a Door

lock_serial = "your_lock_serial_number"
success = api.actions_manager.lock_door(lock_serial)
if success:
    print("Door locked successfully.")
else:
    print("Failed to lock the door.")

Unlocking a Door

lock_serial = "your_lock_serial_number"
success = api.actions_manager.unlock_door(lock_serial)
if success:
    print("Door unlocked successfully.")
else:
    print("Failed to unlock the door.")

API Reference

Please refer to the code documentation and docstrings within the library for more detailed information on available methods and their usage.

Dependencies

requests: Used for making HTTP requests to the Sector Alarm API. License This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This library is not affiliated with or endorsed by Sector Alarm. Use it responsibly and at your own risk.

Contributing

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

Contact

For questions or suggestions, please contact Jonathan Petersson jpetersson@garnser.se.

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

sectoralarm-1.1.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

sectoralarm-1.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file sectoralarm-1.1.2.tar.gz.

File metadata

  • Download URL: sectoralarm-1.1.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for sectoralarm-1.1.2.tar.gz
Algorithm Hash digest
SHA256 3cf6026d49516944cf0e8b7abd4b46ad1ad3babac9fabe5aca385cc89d29057e
MD5 74640c144fcadf7f382a55dbe0e20c76
BLAKE2b-256 a9363ead7c6d494ad79d0f9632625e878c4c0f13829605e5009ebfbd6fe2ee5f

See more details on using hashes here.

File details

Details for the file sectoralarm-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: sectoralarm-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for sectoralarm-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b107d3653436efec1800f33ac93644e0719842e8baa51c868c6a36561bff75c3
MD5 0477a56a6399c8862b6234071e1b9c8c
BLAKE2b-256 94dd8917ee1c3115df61a6314c2ebc35461fb33dab7f24b27c49778643dd5ab0

See more details on using hashes here.

Supported by

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