lavviebotaio


Namelavviebotaio JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/RobertD502/lavviebotaio
SummaryAsynchronous Python library for the PurrSong API utilized by LavvieBot S litter boxes
upload_time2024-02-06 23:57:18
maintainer
docs_urlNone
authorRobert Drinovac
requires_python>=3.9
license
keywords lavviebot lavviebot s purrsong litter box
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Lavviebotaio
Asynchronous Python library for the PurrSong API utilized by LavvieBot S litter boxes, LavvieScanners, and LavvieTags.

This package provides an API client for the [PurrSong](https://purrsong.com/en/) API allowing you to fetch the status of Lavviebot S litter boxes, LavvieScanners, LavvieTags, and cats associated with a PurrSong account.


**The API is not published by PurrSong, so it may break without notice.**


## Installation

```
pip3 install lavviebotaio
```

This package depdends on [aiohttp](https://docs.aiohttp.org/en/stable/), and requires Python 3.9 or greater.

## Usage

```python
import asyncio
from lavviebot import LavviebotClient
from aiohttp import ClientSession

async def main():
    async with ClientSession() as session:
    
        # Create a client using PurrSong account email and password
        client = LavviebotClient("email", "password", session)

        # Discover all devices associated with PurrSong account
        devices = await client.async_discover_devices()
        
        # Discover all cats associated with account. Requires `location id` as an `int`.
        cats = await client.async_discover_cats(123)
        
        # Get info pertaining to a particular litter box (state, usage, error log) using device_id integer
        litter_box_status = await self.async_get_litter_box_status(device_id)
        
        # Get litter box usage log pertaining to a particular litter box using device_id integer
        litter_box_log = await client.async_get_litter_box_cat_log(device_id)
        
        # Get weights, durations, and usage counts for "Unknown" cat using cat_id integer (cat_id for unknown cats is equal to the location_id)
        unknown_cat_status = await client.async_get_unknown_status(cat_id)
        
        # Get weights, durations, and usage counts for a particular cat using cat_id integer
        cat_status = await client.async_get_cat_status(cat_id)

        # Get info about a particular LavvieScanner using device_id and device_type of "lavvie_scanner")
        lavvie_scanner = await client.async_get_iot_device_status(device_id, "lavvie_scanner")

        # Get info about a particular LavvieTag using device_id and device_type of "lavvie_tag")
        lavvie_tag = await client.async_get_iot_device_status(device_id, "lavvie_tag")
        
        # Get all associated litter boxes, scanners, tags, and cats and store in a LavviebotData object
        get_all = await client.async_get_data()


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/RobertD502/lavviebotaio",
    "name": "lavviebotaio",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "lavviebot,lavviebot s,purrsong,litter box",
    "author": "Robert Drinovac",
    "author_email": "unlisted@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/68/7c/0d9cf9c52af7deebdb3ce1580ac19098a557cead60fea1288ee02b8b1b27/lavviebotaio-0.3.0.tar.gz",
    "platform": null,
    "description": "# Lavviebotaio\nAsynchronous Python library for the PurrSong API utilized by LavvieBot S litter boxes, LavvieScanners, and LavvieTags.\n\nThis package provides an API client for the [PurrSong](https://purrsong.com/en/) API allowing you to fetch the status of Lavviebot S litter boxes, LavvieScanners, LavvieTags, and cats associated with a PurrSong account.\n\n\n**The API is not published by PurrSong, so it may break without notice.**\n\n\n## Installation\n\n```\npip3 install lavviebotaio\n```\n\nThis package depdends on [aiohttp](https://docs.aiohttp.org/en/stable/), and requires Python 3.9 or greater.\n\n## Usage\n\n```python\nimport asyncio\nfrom lavviebot import LavviebotClient\nfrom aiohttp import ClientSession\n\nasync def main():\n    async with ClientSession() as session:\n    \n        # Create a client using PurrSong account email and password\n        client = LavviebotClient(\"email\", \"password\", session)\n\n        # Discover all devices associated with PurrSong account\n        devices = await client.async_discover_devices()\n        \n        # Discover all cats associated with account. Requires `location id` as an `int`.\n        cats = await client.async_discover_cats(123)\n        \n        # Get info pertaining to a particular litter box (state, usage, error log) using device_id integer\n        litter_box_status = await self.async_get_litter_box_status(device_id)\n        \n        # Get litter box usage log pertaining to a particular litter box using device_id integer\n        litter_box_log = await client.async_get_litter_box_cat_log(device_id)\n        \n        # Get weights, durations, and usage counts for \"Unknown\" cat using cat_id integer (cat_id for unknown cats is equal to the location_id)\n        unknown_cat_status = await client.async_get_unknown_status(cat_id)\n        \n        # Get weights, durations, and usage counts for a particular cat using cat_id integer\n        cat_status = await client.async_get_cat_status(cat_id)\n\n        # Get info about a particular LavvieScanner using device_id and device_type of \"lavvie_scanner\")\n        lavvie_scanner = await client.async_get_iot_device_status(device_id, \"lavvie_scanner\")\n\n        # Get info about a particular LavvieTag using device_id and device_type of \"lavvie_tag\")\n        lavvie_tag = await client.async_get_iot_device_status(device_id, \"lavvie_tag\")\n        \n        # Get all associated litter boxes, scanners, tags, and cats and store in a LavviebotData object\n        get_all = await client.async_get_data()\n\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n```",
    "bugtrack_url": null,
    "license": "",
    "summary": "Asynchronous Python library for the PurrSong API utilized by LavvieBot S litter boxes",
    "version": "0.3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/RobertD502/lavviebotaio/issues",
        "Homepage": "https://github.com/RobertD502/lavviebotaio",
        "Source": "https://github.com/RobertD502/lavviebotaio/"
    },
    "split_keywords": [
        "lavviebot",
        "lavviebot s",
        "purrsong",
        "litter box"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "687c0d9cf9c52af7deebdb3ce1580ac19098a557cead60fea1288ee02b8b1b27",
                "md5": "7e8ba3b47830d4f59490e7707b5efc4d",
                "sha256": "e3f128e102ee22fd88f811b1b3e36aacca914f7c1203accb7b1432712ab6da29"
            },
            "downloads": -1,
            "filename": "lavviebotaio-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7e8ba3b47830d4f59490e7707b5efc4d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11920,
            "upload_time": "2024-02-06T23:57:18",
            "upload_time_iso_8601": "2024-02-06T23:57:18.725312Z",
            "url": "https://files.pythonhosted.org/packages/68/7c/0d9cf9c52af7deebdb3ce1580ac19098a557cead60fea1288ee02b8b1b27/lavviebotaio-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-06 23:57:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RobertD502",
    "github_project": "lavviebotaio",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "lavviebotaio"
}
        
Elapsed time: 2.25978s