Skip to main content

Python package for controlling Whisker automatic robots.

Project description

pylitterbot

PyPI - Version Buy Me A Coffee/Beer Sponsor on GitHub Purchase Litter-Robot

GitHub License PyPI - Python Version Pepy Total Downloads PyPI - Downloads

Python package for controlling Whisker connected self-cleaning litter boxes and feeders.

This is an unofficial API for controlling various Whisker automated robots. It currently supports Litter-Robot 3 (with connect), Litter-Robot 4 and Feeder-Robot.

Disclaimer

This API is experimental and was reverse-engineered by monitoring network traffic and decompiling source code from the Whisker app since no public API is currently available at this time. It may cease to work at any time. Use at your own risk.

Installation

Install using pip

pip install pylitterbot

Alternatively, clone the repository and run

uv sync

Usage

import asyncio

from pylitterbot import Account

# Set email and password for initial authentication.
username = "Your username"
password = "Your password"


async def main():
    # Create an account.
    account = Account()

    try:
        # Connect to the API and load robots.
        await account.connect(username=username, password=password, load_robots=True)

        # Print robots associated with account.
        print("Robots:")
        for robot in account.robots:
            print(robot)
    finally:
        # Disconnect from the API.
        await account.disconnect()


if __name__ == "__main__":
    asyncio.run(main())

which will output something like:

Name: Litter-Robot Name, Serial: LR3C012345, id: a0123b4567cd8e

To start a clean cycle

await robot.start_cleaning()

If no exception occurred, your Litter-Robot should now perform a clean cycle.

Currently the following methods are available in the Robot class:

  • refresh()
  • start_cleaning()
  • reset_settings()
  • set_panel_lockout()
  • set_night_light()
  • set_power_status()
  • set_sleep_mode()
  • set_wait_time()
  • set_name()
  • get_activity_history()
  • get_insight()

Contributing

Thank you for your interest in contributing! Follow these steps to set up your environment and ensure your changes meet the project's standards.

Setup

  1. Clone this repository:
    git clone https://github.com/natekspencer/pylitterbot.git
    cd pylitterbot
    
  2. Install dependencies and pre-commit hooks:
    uv sync
    pre-commit install
    

Guidelines

  • Code Formatting: Ensure your code is properly formatted. This project uses ruff for linting and formatting.
  • Typing: All code must be fully typed. Use mypy to check for type issues:
    mypy .
    
  • Testing: Add tests for any new features or changes. Run the test suite with:
    pytest
    
  • Commit Messages: Follow conventional commit messages, e.g., feat: add new feature or fix: resolve issue with X

Submitting Changes

  1. Create a new branch for your feature or fix:
    git checkout -b feature/your-feature
    
  2. Make your changes and commit them.
  3. Push to your fork and open a pull request.

I appreciate your contributions! 🚀


TODO

  • Validate Litter-Robot EVO model data/endpoints if it differs from Litter-Robot 5
  • Add support for Litter-Robot 5 cameras

❤️ Support Me

I maintain this python project in my spare time. If you find it useful, consider supporting development:

If you don't already own a Litter-Robot, please consider using my referral link to purchase your own robot and save $50!

📈 Star History

Star History Chart

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

pylitterbot-2025.1.0.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylitterbot-2025.1.0-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file pylitterbot-2025.1.0.tar.gz.

File metadata

  • Download URL: pylitterbot-2025.1.0.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pylitterbot-2025.1.0.tar.gz
Algorithm Hash digest
SHA256 5a2f1356eb2896104ade2a9a97b8b6e92b45468b1a2e7e7d6076e912c9b37c1b
MD5 b48601a5be49a624cca6461d3dbd7426
BLAKE2b-256 2a17abb608e151846a54902583cd39e75df50576fc5886da7fd86c662fa1ade0

See more details on using hashes here.

File details

Details for the file pylitterbot-2025.1.0-py3-none-any.whl.

File metadata

  • Download URL: pylitterbot-2025.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pylitterbot-2025.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db3070088cb017cc97c4e121f3a315bd878458066cc944239e3a997a73746981
MD5 c0d3cddb43e03ae044f4a651d5ca8636
BLAKE2b-256 a2bbd57f9f56aa0e4a2fa89eff398006bf44f218c484f8239839e513b873c9ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page