[![GitHub Latest Release][releases_shield]][latest_release]
[![PyPI][pypi_releases_shield]][pypi_latest_release]
[![PyPI - Downloads][pypi_downloads_shield]][pypi_downloads]
[![Ko-Fi][ko_fi_shield]][ko_fi]
[![buycoffee.to][buycoffee_to_shield]][buycoffee_to]
[![PayPal.Me][paypal_me_shield]][paypal_me]
[![Revolut.Me][revolut_me_shield]][revolut_me]


[latest_release]: https://github.com/PiotrMachowski/Python-package-vacuum-map-parser-roborock/releases/latest
[releases_shield]: https://img.shields.io/github/release/PiotrMachowski/Python-package-vacuum-map-parser-roborock.svg?style=popout

[pypi_latest_release]: https://pypi.org/project/vacuum-map-parser-roborock/
[pypi_releases_shield]: https://img.shields.io/pypi/v/vacuum-map-parser-roborock

[pypi_downloads]: https://pepy.tech/project/vacuum-map-parser-roborock
[pypi_downloads_shield]: https://static.pepy.tech/badge/vacuum-map-parser-roborock

# Vacuum map parser - Roborock

Map data parser that can be used to parse maps generated by Roborock vacuums.

## Installation

```shell
pip install vacuum-map-parser-roborock
```

## Usage

```python
from vacuum_map_parser_base.config.color import ColorsPalette
from vacuum_map_parser_base.config.drawable import Drawable
from vacuum_map_parser_base.config.image_config import ImageConfig
from vacuum_map_parser_base.config.size import Sizes
from vacuum_map_parser_base.config.text import Text
from vacuum_map_parser_roborock.map_data_parser import RoborockMapDataParser

palette: ColorsPalette = ColorsPalette()
sizes: Sizes = Sizes()
drawables: list[Drawable] = [Drawable.PATH, Drawable.CHARGER]
image_config: ImageConfig = ImageConfig()
texts: list[Text] = []
raw_map: bytes = b''

parser = RoborockMapDataParser(palette, sizes, drawables, image_config, texts)

unpacked_map = parser.unpack_map(raw_map)
parsed_map = parser.parse(unpacked_map)
```

## Special thanks

This library wouldn't exist without following projects:
 - [openHAB miIO add-on](https://github.com/openhab/openhab-addons/tree/main/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio) by [@marcelrv](https://github.com/marcelrv)
 - [Xiaomi Robot Vacuum Protocol](https://github.com/marcelrv/XiaomiRobotVacuumProtocol) by [@marcelrv](https://github.com/marcelrv)

## Support

If you want to support my work with a donation you can use one of the following platforms:

     Platform
     Payment methods
     Link
     Comment

     Ko-fi
           
- PayPal
      
- Credit card

- No fees
      
- Single or monthly payment

     buycoffee.to
           
- BLIK
      
- Bank transfer

     PayPal
           
- PayPal

- No fees

     Revolut
           
- Revolut
      
- Credit Card

- No fees

[ko_fi_shield]: https://img.shields.io/static/v1.svg?label=%20&message=Ko-Fi&color=F16061&logo=ko-fi&logoColor=white

[ko_fi]: https://ko-fi.com/piotrmachowski

[buycoffee_to_shield]: https://shields.io/badge/buycoffee.to-white?style=flat&labelColor=white&logo=data:image/png;base64, 

[buycoffee_to]: https://buycoffee.to/piotrmachowski

[buy_me_a_coffee_shield]: https://img.shields.io/static/v1.svg?label=%20&message=Buy%20me%20a%20coffee&color=6f4e37&logo=buy%20me%20a%20coffee&logoColor=white

[buy_me_a_coffee]: https://www.buymeacoffee.com/PiotrMachowski

[paypal_me_shield]: https://img.shields.io/static/v1.svg?label=%20&message=PayPal.Me&logo=paypal

[paypal_me]: https://paypal.me/PiMachowski

[revolut_me_shield]: https://img.shields.io/static/v1.svg?label=%20&message=Revolut&logo=revolut

[revolut_me]: https://revolut.me/314ma
