Skip to main content

A Python client for HKC SecureComm API

Project description

HKC Alarm API Python Wrapper

Python module for interacting with HKC's Alarm API, allowing for easy interactions with the alarm system.

Note: This uses a private API, which means it is subject to change without notice and can break at any time. Always be cautious and respectful when using private APIs. To mimic the behavior of the app and reduce the chance of being rate-limited or blocked, it is recommended to limit requests to the API to one every 5-10 seconds, especially when fetching logs or inputs, similar to HKC's new v2 App.

Features

  • Retrieve system status.
  • Fetch all inputs.
  • View recent logs.
  • Arm and disarm the alarm in various modes.

Installation

  1. Clone this repository:
git clone https://github.com/jasonmadigan/pyhkc
  1. Navigate to the repository's directory:
cd pyhkc
  1. Install the required packages:
pip install -r requirements.txt

Dependencies

  • requests==2.31.0
  • tabulate==0.9.0

Example Usage

from hkc_alarm import HKCAlarm

# Initialize the system with your credentials.
panel_id = [your-panel-id]  # replace with your panel ID
panel_password = "[your-panel-password]"  # replace with your panel password
user_code = [your-user-code]  # replace with your user code

alarm_system = HKCAlarm(panel_id, panel_password, user_code)

# Retrieve system status.
status = alarm_system.get_system_status()
print("System Status:", status)

# Fetch all inputs.
inputs = alarm_system.get_all_inputs()
print("All Inputs:", inputs)

# View recent logs.
logs = alarm_system.fetch_logs()
print("Recent Logs:", logs)

# Arm the system.
# alarm_system.arm_fullset()

# Disarm the system.
# alarm_system.disarm()

Publishing

python3 setup.py sdist bdist_wheel
twine upload dist/*

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

pyhkc-0.4.6.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

pyhkc-0.4.6-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file pyhkc-0.4.6.tar.gz.

File metadata

  • Download URL: pyhkc-0.4.6.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pyhkc-0.4.6.tar.gz
Algorithm Hash digest
SHA256 de8a2a4c98d0638b959b82ee2d6a09177fa64cb0e47d43d637c8f008ccf72d74
MD5 d90c4d57bf86c086dddd602b4074f7bf
BLAKE2b-256 90a52c116655801784e466ef1729c16b9df1c3698d4a71fb4e5887ab62a77151

See more details on using hashes here.

File details

Details for the file pyhkc-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: pyhkc-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pyhkc-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 50018b7b0d4043b812627aa5ac294087b95388ecf6e687784bec576fbd3723c7
MD5 3087b80c89602b4226cb6d494d19e433
BLAKE2b-256 cbd2aa199c31498bc8fa194d5785c1a2d63c5d05f46c23d32dd261c82f381485

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