Async Python driver for the DSC IT-100 serial integration module
Project description
dsc-it100
Async Python driver for the DSC IT-100 serial integration module.
Installation
pip install dsc-it100
Quick start
import asyncio
from dsc_it100 import IT100
from dsc_it100.constants import CMD_ZONE_OPEN, CMD_PARTITION_ARMED
def handle_zone_update(driver, pkt):
d = pkt['parsed']
if pkt['command'] == CMD_ZONE_OPEN:
print(f"Zone {d['zone']} opened")
def handle_partition_update(driver, pkt):
d = pkt['parsed']
if pkt['command'] == CMD_PARTITION_ARMED:
print(f"Partition {d['partition']} armed ({d['mode']})")
def handle_general_update(driver, pkt):
print(f"Event {pkt['command']}: {pkt['parsed']}")
async def main():
panel = IT100('/dev/ttyUSB0', baud=9600)
panel.handler_zone_update = handle_zone_update
panel.handler_partition_update = handle_partition_update
panel.handler_general_update = handle_general_update
await panel.connect()
await asyncio.sleep(0)
await panel.poll()
await panel.request_status()
await panel.request_labels()
try:
await asyncio.Future()
except (KeyboardInterrupt, asyncio.CancelledError):
pass
finally:
await panel.disconnect()
asyncio.run(main())
Event handlers
| Property | Fires when |
|---|---|
handler_zone_update |
packet contains a zone field (open, close, alarm, tamper, fault) |
handler_partition_update |
packet contains a partition field but no zone (ready, armed, disarmed, delay, alarm) |
handler_general_update |
every incoming packet (catch-all) |
Each handler receives (driver, packet) where packet is:
{
'command': '609', # 3-digit IT-100 command code
'data': '001', # raw data field
'checksum': 'CC',
'valid': True,
'parsed': {'zone': 1}, # command-specific parsed fields
}
Handlers may be plain functions or coroutines.
Commands
await panel.poll()
await panel.request_status()
await panel.request_labels()
await panel.arm_away(partition=1)
await panel.arm_stay(partition=1)
await panel.arm_with_code(partition=1, code='1234')
await panel.disarm(partition=1, code='1234')
await panel.trigger_panic()
await panel.bypass_zone(zone=3, code='1234')
Requirements
- Python 3.10+
- pyserial
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_dsc_it100-1.0.0.tar.gz.
File metadata
- Download URL: py_dsc_it100-1.0.0.tar.gz
- Upload date:
- Size: 172.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca74c27a4e1433402733867c0bdffc9c8d701036ff068d22f238a1492070e06c
|
|
| MD5 |
dbf6fb562271e8fc3d51d2dd5d0fe926
|
|
| BLAKE2b-256 |
abf9d8ac4f4a378c1d8bcde1964be48c9e254c8475e968126b6b75881f2d9e1e
|
Provenance
The following attestation bundles were made for py_dsc_it100-1.0.0.tar.gz:
Publisher:
publish.yml on SG14-96/dsc_it100
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_dsc_it100-1.0.0.tar.gz -
Subject digest:
ca74c27a4e1433402733867c0bdffc9c8d701036ff068d22f238a1492070e06c - Sigstore transparency entry: 1394938077
- Sigstore integration time:
-
Permalink:
SG14-96/dsc_it100@d41b0e874a6a70c2520beda9693ecef89c65a0e2 -
Branch / Tag:
refs/tags/V1.0.0 - Owner: https://github.com/SG14-96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d41b0e874a6a70c2520beda9693ecef89c65a0e2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file py_dsc_it100-1.0.0-py3-none-any.whl.
File metadata
- Download URL: py_dsc_it100-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec2af59af3457db1fba31d3e90dcf0ff7efc81a7967372c40d0ce14bc17d6221
|
|
| MD5 |
82020f154a4c98fcb15fde4a3159fe24
|
|
| BLAKE2b-256 |
71dff3ec8ff3f88a949046b5b5f1a40442b66fae32928728be97fc2b871c7470
|
Provenance
The following attestation bundles were made for py_dsc_it100-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on SG14-96/dsc_it100
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_dsc_it100-1.0.0-py3-none-any.whl -
Subject digest:
ec2af59af3457db1fba31d3e90dcf0ff7efc81a7967372c40d0ce14bc17d6221 - Sigstore transparency entry: 1394938082
- Sigstore integration time:
-
Permalink:
SG14-96/dsc_it100@d41b0e874a6a70c2520beda9693ecef89c65a0e2 -
Branch / Tag:
refs/tags/V1.0.0 - Owner: https://github.com/SG14-96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d41b0e874a6a70c2520beda9693ecef89c65a0e2 -
Trigger Event:
release
-
Statement type: