Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.5.1 instead.
Reason given by maintainers: Missing version update

Power Pet Door Python Library

Buy Me Coffee

Tests Github Release Github Activity License

PyPI Python Versions

A Python library for communicating with Power Pet Door WiFi-enabled pet doors made by High Tech Pet.

Power Pet Door

Disclaimer

This library is NOT authorized, endorsed, or supported by High Tech Pet Products, Inc.

This is an independent, community-developed project. No contributions, financial or otherwise, have been received from High Tech Pet. If you need official support for your Power Pet Door, please contact High Tech Pet directly.

Installation

pip install pypowerpetdoor

Requires Python 3.11-3.14. Supported platforms: Linux and macOS. The library itself has no platform-specific code, but the simulator's plain-stdin prompt fallback uses loop.add_reader() on stdin, which Windows' ProactorEventLoop does not implement, and CI runs on Linux only - so Windows is not a claimed platform.

Quick Start

The library provides two interfaces:

A high-level, Pythonic interface with cached state and simple methods:

import asyncio
from powerpetdoor import PowerPetDoor

async def main():
    door = PowerPetDoor("192.168.1.100")
    await door.connect()

    # Read state via properties
    print(f"Door status: {door.status.name}")
    print(f"Battery: {door.battery_percent}%")

    # Control via async methods
    if door.is_closed:
        await door.open()

    await door.set_hold_time(15)
    await door.set_inside_sensor(True)

    # Register callbacks
    door.on_status_change(lambda s: print(f"Status: {s.name}"))

    await door.disconnect()

asyncio.run(main())

See docs/door.md for complete documentation.

PowerPetDoorClient (Low-Level)

For advanced use cases requiring direct protocol access:

import asyncio
from powerpetdoor import PowerPetDoorClient, CONFIG, CMD_GET_SETTINGS

async def main():
    loop = asyncio.get_running_loop()

    client = PowerPetDoorClient(
        host="192.168.1.100",
        port=3000,
        keepalive=30.0,
        timeout=10.0,
        reconnect=5.0,
        loop=loop
    )

    await client.connect()

    settings = await client.send_message(CONFIG, CMD_GET_SETTINGS, notify=True)
    print(f"Settings: {settings}")

    client.stop()

asyncio.run(main())

See docs/client.md for complete documentation.

Documentation

Document Description
docs/door.md PowerPetDoor high-level interface
docs/client.md PowerPetDoorClient low-level interface
docs/simulator.md Door simulator for testing

Door Simulator

The library includes a full-featured door simulator for testing without hardware:

# Run interactive simulator (also available as the ppd-simulator entry point)
python -m powerpetdoor.simulator

# Run with a test script (built-in name or file path)
python -m powerpetdoor.simulator --script basic_cycle

# Run in CI/CD (exit on completion; exit code reflects pass/fail)
python -m powerpetdoor.simulator --script full_test_suite --oneshot

See docs/simulator.md for complete documentation.

Library Structure

powerpetdoor/
├── door.py            # PowerPetDoor high-level interface
├── client.py          # PowerPetDoorClient low-level client
├── const.py           # Protocol constants and commands
├── framing.py         # Shared JSON frame scanner for the wire protocol
├── sanitize.py        # Terminal-safety helper for untrusted text (shared)
├── schedule.py        # Schedule utilities
├── tz_utils.py        # Timezone utilities
└── simulator/         # Door simulator submodule
    ├── state.py           # Simulator state dataclasses
    ├── protocol.py        # Protocol handler (asyncio Protocol + command registry)
    ├── engine.py          # DoorMotionEngine (shared door-motion state machine)
    ├── server.py          # DoorSimulator server
    ├── cli.py             # ppd-simulator CLI (interactive/script/daemon modes)
    ├── ctl.py             # ppd-simulator-ctl remote-control client
    ├── prompt_common.py   # Shared prompt_toolkit machinery (highlighting, completion)
    ├── commands/          # Interactive command implementations
    ├── scripting.py       # YAML script runner
    └── scripts/           # Built-in test scripts

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.


Release files for pypowerpetdoor 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypowerpetdoor 0.4.0
File Size Uploaded
pypowerpetdoor-0.4.0.tar.gz 610.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypowerpetdoor 0.4.0
File Interpreter ABI Platform
pypowerpetdoor-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 827.8 kB

Release files / pypowerpetdoor-0.4.0.tar.gz

Download URL pypowerpetdoor-0.4.0.tar.gz
Size 610.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0286c226f65ddd95b67fbcb54bec60fbc46a3d0af8b03a8b45671f9a067b8fcc
BLAKE2b-256 checksum
How to use checksums
eda54ae14cae24bece816c1f27df97f72a58a30c8199fa189f604efa856724f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release files / pypowerpetdoor-0.4.0-py3-none-any.whl

Download URL pypowerpetdoor-0.4.0-py3-none-any.whl
Size 217.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57f930868364e70fb38a6172c63f75ab9d7c91c53f02e9f5efdce3f30d620d5e
BLAKE2b-256 checksum
How to use checksums
94b5033d03b3ecbfa3ef2611db61814ca1ded3c27b56d55f95d64d5962d71930
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page