Python library for communicating with Power Pet Door devices
Project description
Power Pet Door Python Library
A Python library for communicating with Power Pet Door devices over the network.
Installation
pip install powerpetdoor
Usage
import asyncio
from powerpetdoor import PowerPetDoorClient, COMMAND, CMD_OPEN, CMD_CLOSE
# Create a client
client = PowerPetDoorClient(
host="192.168.1.100",
port=3000,
keepalive=30.0,
timeout=10.0,
reconnect=5.0
)
# Add a listener for door status updates
client.add_listener(
name="my_app",
door_status_update=lambda status: print(f"Door status: {status}")
)
# Start the client (blocks if running own event loop)
# For integration with existing event loop, pass it to the constructor
client.start()
# Send commands
client.send_message(COMMAND, CMD_OPEN)
client.send_message(COMMAND, CMD_CLOSE)
# Stop when done
client.stop()
Async Usage
For use with an existing asyncio event loop:
import asyncio
from powerpetdoor import PowerPetDoorClient, COMMAND, CMD_GET_SETTINGS, CONFIG
async def main():
loop = asyncio.get_event_loop()
client = PowerPetDoorClient(
host="192.168.1.100",
port=3000,
keepalive=30.0,
timeout=10.0,
reconnect=5.0,
loop=loop
)
# Connect
await client.connect()
# Send a command and wait for response
settings = await client.send_message(CONFIG, CMD_GET_SETTINGS, notify=True)
print(f"Settings: {settings}")
# Disconnect
client.stop()
asyncio.run(main())
Schedule Utilities
The library includes utilities for working with Power Pet Door schedules:
from powerpetdoor import (
compress_schedule,
validate_schedule_entry,
compute_schedule_diff,
schedule_template,
)
# Validate a schedule entry
entry = {...}
if validate_schedule_entry(entry):
print("Entry is valid")
# Compress multiple schedule entries
compressed = compress_schedule(schedule_list)
# Compute differences between schedules
to_delete, to_add = compute_schedule_diff(current, new)
License
MIT License - see LICENSE file for details.
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 pypowerpetdoor-0.1.0.tar.gz.
File metadata
- Download URL: pypowerpetdoor-0.1.0.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c5d15864d279ccb0c64f75052e734b43bb94e0f3e0dddaf1dc0c2f33eec15d3
|
|
| MD5 |
27b9619a6a364e5179054b272786fa37
|
|
| BLAKE2b-256 |
7d9eb049ae7689183afd779e5d6b939240414685391771b9e1ed94eeb005335e
|
Provenance
The following attestation bundles were made for pypowerpetdoor-0.1.0.tar.gz:
Publisher:
ci.yml on corporategoth/py-powerpetdoor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypowerpetdoor-0.1.0.tar.gz -
Subject digest:
4c5d15864d279ccb0c64f75052e734b43bb94e0f3e0dddaf1dc0c2f33eec15d3 - Sigstore transparency entry: 779969954
- Sigstore integration time:
-
Permalink:
corporategoth/py-powerpetdoor@3a86756f6d7a36c0ab24b50c62f00ed419b18dcf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/corporategoth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@3a86756f6d7a36c0ab24b50c62f00ed419b18dcf -
Trigger Event:
release
-
Statement type:
File details
Details for the file pypowerpetdoor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pypowerpetdoor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a6e8ccd4470e16ca002f6ce7c378394d8014cb701d7ea2ff87fb0615b3172ac
|
|
| MD5 |
5442913d9fd36394a797e151c0194060
|
|
| BLAKE2b-256 |
65757e31abcfbe18c93804f614bbf5f22774f765cbd5c830dc0897384cf7e4f3
|
Provenance
The following attestation bundles were made for pypowerpetdoor-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on corporategoth/py-powerpetdoor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypowerpetdoor-0.1.0-py3-none-any.whl -
Subject digest:
3a6e8ccd4470e16ca002f6ce7c378394d8014cb701d7ea2ff87fb0615b3172ac - Sigstore transparency entry: 779969961
- Sigstore integration time:
-
Permalink:
corporategoth/py-powerpetdoor@3a86756f6d7a36c0ab24b50c62f00ed419b18dcf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/corporategoth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@3a86756f6d7a36c0ab24b50c62f00ed419b18dcf -
Trigger Event:
release
-
Statement type: