Metadata-Version: 2.4
Name: python-roborock
Version: 3.10.2
Summary: A package to control Roborock vacuums.
Project-URL: Repository, https://github.com/humbertogontijo/python-roborock
Project-URL: Documentation, https://python-roborock.readthedocs.io/
Author: Lash-L, allenporter
Author-email: humbertogontijo <humbertogontijo@users.noreply.github.com>
License-Expression: GPL-3.0-only
License-File: LICENSE
Keywords: homeassistant,roborock,vacuum
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <4,>=3.11
Requires-Dist: aiohttp<4,>=3.8.2
Requires-Dist: aiomqtt<3,>=2.3.2
Requires-Dist: click-shell~=2.1
Requires-Dist: click>=8
Requires-Dist: construct<3,>=2.10.57
Requires-Dist: paho-mqtt<3.0.0,>=1.6.1
Requires-Dist: pycryptodomex~=3.18; sys_platform == 'darwin'
Requires-Dist: pycryptodome~=3.18
Requires-Dist: pyrate-limiter<4,>=3.7.0
Requires-Dist: vacuum-map-parser-roborock
Description-Content-Type: text/markdown

# Roborock

<p align="center">
  <a href="https://pypi.org/project/python-roborock/">
    <img src="https://img.shields.io/pypi/v/python-roborock.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
  </a>
  <img src="https://img.shields.io/pypi/pyversions/python-roborock.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
  <img src="https://img.shields.io/pypi/l/python-roborock.svg?style=flat-square" alt="License">
</p>

Roborock library for online and offline control of your vacuums.

## Installation

Install this via pip (or your favourite package manager):

`pip install python-roborock`

## Functionality

You can see all of the commands supported [here](https://python-roborock.readthedocs.io/en/latest/api_commands.html)

## Example Usage

```python
import asyncio

from roborock.web_api import RoborockApiClient
from roborock.devices.device_manager import create_device_manager, UserParams


async def main():
    web_api = RoborockApiClient(username="youremailhere")
    # Login via your password
    user_data = await web_api.pass_login(password="pass_here")
    # Or login via a code
    await web_api.request_code()
    code = input("What is the code?")
    user_data = await web_api.code_login(code)

    # Create a device manager that can discover devices.
    user_params = UserParams(
        username="youremailhere",
        user_data=user_data,
    )
    device_manager = await create_device_manager(user_params)
    devices = await device_manager.get_devices()

    # Get all vacuum devices that support the v1 PropertiesApi
    for device in devices:
        if not device.v1_properties:
            continue

        # Refresh the current device status
        status_trait = device.v1_properties.status
        await status_trait.refresh()
        print(status_trait)

asyncio.run(main())
```

See [examples/example.py](examples/example.py) for a more full featured example
that has performance improvements to cache cloud information to prefer
connections over the local network.

## Supported devices

You can find what devices are supported
[here](https://python-roborock.readthedocs.io/en/latest/supported_devices.html).
Please note this may not immediately contain the latest devices.


## Credits

Thanks @rovo89 for https://gist.github.com/rovo89/dff47ed19fca0dfdda77503e66c2b7c7 And thanks @PiotrMachowski for https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor
