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()

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.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyhkc-0.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyhkc-0.1.tar.gz
Algorithm Hash digest
SHA256 e1b6e40aaa8aa01cc50338dd2fea87bcca5440bb4da0615a4712c3efe6cb5539
MD5 9b304e68df5d23950924a735c30320f5
BLAKE2b-256 d3c05348380a006e17b440860799d551f2119d90e85aa3b627d10bd8ae2a1bd5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyhkc-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b628be6e40b1a65039344a2d9408fb15ef5dee8b955d8abbd46c702029a3728
MD5 1d521b97ce343c5da5768592f14404d0
BLAKE2b-256 d3da3c6c848f8e15fa4ee7ef17baa377f2633f158a3cc4d346acf9dc0dc65f61

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