Skip to main content

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/
├── __init__.py        # Public API surface (see __all__)
├── 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
├── i18n.py            # t() translation lookup for user-facing text
├── locales/           # Translation catalogue and per-language files
│   └── messages.json      # Generated key -> English catalogue
├── sanitize.py        # Terminal-safety helper for untrusted text (shared)
├── schedule.py        # Schedule utilities
├── tz_utils.py        # Timezone utilities
├── py.typed           # PEP 561 marker; downstream mypy sees real types
└── 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.2

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.2
File Size Uploaded
pypowerpetdoor-0.4.2.tar.gz 629.5 kB Details

Built distribution (wheel)

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

Total release size: 850.8 kB

Release files / pypowerpetdoor-0.4.2.tar.gz

Download URL pypowerpetdoor-0.4.2.tar.gz
Size 629.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7c59fc3217e1c5b6dc400a0f3776ae58d7aaf045236c50043f8687996c976c44
BLAKE2b-256 checksum
How to use checksums
2db161147b750901cbfd96524a5f8b104bffb148c9ed8c17e25794d30e7cd0fc
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 24, 2026.

Transparency log

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

Download URL pypowerpetdoor-0.4.2-py3-none-any.whl
Size 221.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a56565c7142e65f3a6e98f1785f92795b1ca01d6716ac1255a5897f0a185e820
BLAKE2b-256 checksum
How to use checksums
bba76ced9522818b1db3dcc441cb9b8b7cfb858b5464707417665a3e71350d64
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 24, 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

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

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