Skip to content

Commit

Permalink
feat: house keeping, version bumping, doc fixes, doc improvements, v2…
Browse files Browse the repository at this point in the history
… home data api (#157)

* feat: version bumping, docs improvements, mypy fixes, doc fixes

* fix: ci steps

* feat: convert to v2 of the api

* chore: linting, include docs, poetry lock

* fix: tests

* fix: add ability to remove listener
  • Loading branch information
Lash-L authored Dec 10, 2023
1 parent 38498a3 commit f3ca9b4
Show file tree
Hide file tree
Showing 17 changed files with 1,008 additions and 488 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5.4.3
- uses: wagoid/commitlint-github-action@v5.4.4
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand Down Expand Up @@ -57,7 +57,6 @@ jobs:
release:
runs-on: ubuntu-latest
environment: release
if: github.ref == 'refs/heads/main'
needs:
- test

Expand All @@ -74,7 +73,13 @@ jobs:
# - Publish to PyPI
- name: Python Semantic Release
uses: relekang/python-semantic-release@v7.34.6
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GH_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_TOKEN }}
- name: Test release
uses: python-semantic-release/python-semantic-release@v7.34.6
if: github.ref_name != 'main'
with:
additional_options: --noop
17 changes: 9 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default_stages: [ commit ]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: debug-statements
- id: check-builtin-literals
Expand All @@ -18,29 +18,30 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-poetry/poetry
rev: 1.3.2
rev: 1.7.1
hooks:
- id: poetry-check
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
- id: black
- id: black
language_version: python3
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.6
hooks:
- id: codespell
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.260
rev: v0.1.7
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.7.1
hooks:
- id: mypy
exclude: cli.py
Expand Down
4 changes: 4 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"

python:
install:
- requirements: docs/requirements.txt
68 changes: 7 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,68 +18,14 @@ Install this via pip (or your favourite package manager):

## Functionality

This package can encrypt and decrypt the following commands:
You can see all of the commands supported [here]("https://python-roborock.readthedocs.io/en/latest/api_commands.html")

## 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.

- GET_CLEAN_RECORD
- GET_CONSUMABLE
- GET_MULTI_MAPS_LIST
- APP_START
- APP_PAUSE
- APP_STOP
- APP_CHARGE
- APP_SPOT
- FIND_ME
- RESUME_ZONED_CLEAN
- RESUME_SEGMENT_CLEAN
- SET_CUSTOM_MODE
- SET_MOP_MODE
- SET_WATER_BOX_CUSTOM_MODE
- RESET_CONSUMABLE
- LOAD_MULTI_MAP
- APP_RC_START
- APP_RC_END
- APP_RC_MOVE
- APP_GOTO_TARGET
- APP_SEGMENT_CLEAN
- APP_ZONED_CLEAN
- APP_GET_DRYER_SETTING
- APP_SET_DRYER_SETTING
- APP_START_WASH
- APP_STOP_WASH
- GET_DUST_COLLECTION_MODE
- SET_DUST_COLLECTION_MODE
- GET_SMART_WASH_PARAMS
- SET_SMART_WASH_PARAMS
- GET_WASH_TOWEL_MODE
- SET_WASH_TOWEL_MODE
- SET_CHILD_LOCK_STATUS
- GET_CHILD_LOCK_STATUS
- START_WASH_THEN_CHARGE
- GET_CURRENT_SOUND
- GET_SERIAL_NUMBER
- GET_TIMEZONE
- GET_SERVER_TIMER
- GET_CUSTOMIZE_CLEAN_MODE
- GET_CLEAN_SEQUENCE
- SET_FDS_ENDPOINT
- ENABLE_LOG_UPLOAD
- APP_WAKEUP_ROBOT
- GET_LED_STATUS
- GET_FLOW_LED_STATUS
- SET_FLOW_LED_STATUS
- GET_SOUND_PROGRESS
- GET_SOUND_VOLUME
- TEST_SOUND_VOLUME
- CHANGE_SOUND_VOLUME
- GET_CARPET_MODE
- SET_CARPET_MODE
- GET_CARPET_CLEAN_MODE
- SET_CARPET_CLEAN_MODE
- UPD_SERVER_TIMER
- SET_SERVER_TIMER
- APP_GET_INIT_STATUS
- SET_APP_TIMEZONE
- GET_NETWORK_INFO

## Credits

Expand Down
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx

sphinx_rtd_theme
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.autosectionlabel",
"sphinx_rtd_theme",
]

intersphinx_mapping = {
Expand Down
5 changes: 5 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Welcome to Roborock's documentation!

This project is under active development.

You can get a Home Assistant integration for Roborock in core
`here <https://www.home-assistant.io/integrations/roborock/>`__ or as a custom integration
`here <https://github.com/humbertogontijo/homeassistant-roborock>`__

Contents
--------

Expand All @@ -16,3 +20,4 @@ Contents
status
error
api_commands
supported_devices
26 changes: 23 additions & 3 deletions docs/source/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Status is a core piece of information for our system. It is used to get a wide v

wash_ready:

fan_power:
fan_power: The strength of the fan suction. Listed as an integer that corresponds to a enum value.

dnd_enabled:
dnd_enabled: 0 or 1 that states if there is a dnd time enabled (does not mean that dnd is on now)

map_status:

Expand All @@ -58,7 +58,7 @@ Status is a core piece of information for our system. It is used to get a wide v

home_sec_enable_password:

adbumper_status: Optional[
adbumper_status:

water_shortage_status:

Expand All @@ -85,3 +85,23 @@ Status is a core piece of information for our system. It is used to get a wide v
unsave_map_reason:

unsave_map_flag:

wash_status:

distance_off:

in_warmup:

dry_status:

rdt:

clean_percent:

rss:

dss:

common_status:

corner_clean_mode:
78 changes: 78 additions & 0 deletions docs/source/supported_devices.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Supported Devices
==================

Note: These links are tracking links with Amazon or Roborock. This allows us to get some analytics and helps us get
'negotiation' power with Roborock. We would like to be able to open a channel of communication with Roborock, and
getting information like this is a great first step.

Note, I have only added links to the new devices, older devices are no longer sold directly by roborock, so to buy them
you have to find them used.

.. list-table:: Robot Vacuums
:widths: 30 20 20
:header-rows: 1

* - Vacuum Model
- Amazon
- Roborock
* - Roborock S4
-
-
* - Roborock S4 Max
-
-
* - Roborock S5 Max
-
-
* - Roborock S6
-
-
* - Roborock S6 Pure
-
-
* - Roborock S6 Max
-
-
* - Roborock S6 MaxV
-
-
* - Roborock S7
-
-
* - Roborock S7 MaxV
-
-
* - Roborock S7 Max Ultra
- `Link <https://amzn.to/3GzpXkS>`__
- `Link <https://roborock.pxf.io/c/2522604/1705455/14848>`__
* - Roborock S8
- `Link <https://amzn.to/3GvrF6E>`__
- `Link <https://roborock.pxf.io/9gjZx4>`__
* - Roborock S8 Pro Ultra
- `Link <https://amzn.to/46KgyRX>`__
- `Link <https://roborock.pxf.io/c/2522604/1669165/14848>`__
* - Roborock Q5
- `Link <https://amzn.to/3NjfAoV>`__
- `Link <https://roborock.pxf.io/xkjvby>`__
* - Roborock Q5 Pro
- `Link <https://amzn.to/3uXplTe>`__
- `Link <https://roborock.pxf.io/9gjZQE>`__
* - Roborock Q7
- `Link <https://amzn.to/41bzrMp>`__
- `Link <https://roborock.pxf.io/q4Lvkb>`__
* - Roborock Q7 Max
- `Link <https://amzn.to/4a6GBpt>`__
- `Link <https://roborock.pxf.io/q4Lvkb>`__
* - Roborock Q8 Max
- `Link <https://amzn.to/47QxaJ9>`__
- `Link <https://roborock.pxf.io/jrG42Z>`__
* - Roborock Q Revo
- `Link <https://amzn.to/3Rw9MuB>`__
- `Link <https://roborock.pxf.io/c/2522604/1705456/14848>`__


Roborock has recently added two other categories of devices, handheld vacuums, and washing machines.
Neither are supported at this time.

There are plans to support the handheld ones, but it uses a newer version of the api that I am still trying to reverse
engineer.
Loading

0 comments on commit f3ca9b4

Please sign in to comment.