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 [your-repo-link]
  1. Navigate to the repository's directory:
cd [your-repo-directory]
  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.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

pyhkc-0.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyhkc-0.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pyhkc-0.2.tar.gz
Algorithm Hash digest
SHA256 5c652b7b5eb3d28624670c9c9eb01cf24f8aa5a79f92dcc58477d2076b258861
MD5 bbd5925c4850fb0fac20577e0d2a0ae0
BLAKE2b-256 b71311b465b0888c39f4e51f2e57e4865cc75a9b20e3598886f0bb5e2678a19f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyhkc-0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pyhkc-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dfab76fc5391de410257e136582dbd45253c2db8e148e3e14802233f84bd2ae5
MD5 6fa5d56d0523877931d35eb246a3c729
BLAKE2b-256 7b59de1d490ec03614b7761acaa16d1e1983f7510d35d01bfa49ae16f0b2b34d

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