Skip to content

Commit f3ca9b4

Browse files
authored
feat: house keeping, version bumping, doc fixes, doc improvements, v2 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
1 parent 38498a3 commit f3ca9b4

File tree

17 files changed

+1008
-488
lines changed

17 files changed

+1008
-488
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- uses: actions/checkout@v3
2121
with:
2222
fetch-depth: 0
23-
- uses: wagoid/commitlint-github-action@v5.4.3
23+
- uses: wagoid/commitlint-github-action@v5.4.4
2424
lint:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
- uses: actions/setup-python@v4
2929
with:
3030
python-version: "3.10"
@@ -57,7 +57,6 @@ jobs:
5757
release:
5858
runs-on: ubuntu-latest
5959
environment: release
60-
if: github.ref == 'refs/heads/main'
6160
needs:
6261
- test
6362

@@ -74,7 +73,13 @@ jobs:
7473
# - Publish to PyPI
7574
- name: Python Semantic Release
7675
uses: relekang/python-semantic-release@v7.34.6
76+
if: github.ref == 'refs/heads/main'
7777
with:
7878
github_token: ${{ secrets.GH_TOKEN }}
7979
repository_username: __token__
8080
repository_password: ${{ secrets.PYPI_TOKEN }}
81+
- name: Test release
82+
uses: python-semantic-release/python-semantic-release@v7.34.6
83+
if: github.ref_name != 'main'
84+
with:
85+
additional_options: --noop

.pre-commit-config.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default_stages: [ commit ]
55

66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.4.0
8+
rev: v4.5.0
99
hooks:
1010
- id: debug-statements
1111
- id: check-builtin-literals
@@ -18,29 +18,30 @@ repos:
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
2020
- repo: https://github.com/python-poetry/poetry
21-
rev: 1.3.2
21+
rev: 1.7.1
2222
hooks:
2323
- id: poetry-check
2424
- repo: https://github.com/PyCQA/isort
2525
rev: 5.12.0
2626
hooks:
2727
- id: isort
28-
- repo: https://github.com/psf/black
29-
rev: 22.12.0
28+
- repo: https://github.com/psf/black-pre-commit-mirror
29+
rev: 23.11.0
3030
hooks:
31-
- id: black
31+
- id: black
32+
language_version: python3
3233
- repo: https://github.com/codespell-project/codespell
33-
rev: v2.2.2
34+
rev: v2.2.6
3435
hooks:
3536
- id: codespell
3637
- repo: https://github.com/charliermarsh/ruff-pre-commit
37-
rev: v0.0.260
38+
rev: v0.1.7
3839
hooks:
3940
- id: ruff
4041
args:
4142
- --fix
4243
- repo: https://github.com/pre-commit/mirrors-mypy
43-
rev: v1.2.0
44+
rev: v1.7.1
4445
hooks:
4546
- id: mypy
4647
exclude: cli.py

.readthedocs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ build:
44
os: ubuntu-22.04
55
tools:
66
python: "3.10"
7+
8+
python:
9+
install:
10+
- requirements: docs/requirements.txt

README.md

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -18,68 +18,14 @@ Install this via pip (or your favourite package manager):
1818

1919
## Functionality
2020

21-
This package can encrypt and decrypt the following commands:
21+
You can see all of the commands supported [here]("https://python-roborock.readthedocs.io/en/latest/api_commands.html")
22+
23+
## Supported devices
24+
25+
You can find what devices are supported
26+
[here]("https://python-roborock.readthedocs.io/en/latest/supported_devices.html").
27+
Please note this may not immediately contain the latest devices.
2228

23-
- GET_CLEAN_RECORD
24-
- GET_CONSUMABLE
25-
- GET_MULTI_MAPS_LIST
26-
- APP_START
27-
- APP_PAUSE
28-
- APP_STOP
29-
- APP_CHARGE
30-
- APP_SPOT
31-
- FIND_ME
32-
- RESUME_ZONED_CLEAN
33-
- RESUME_SEGMENT_CLEAN
34-
- SET_CUSTOM_MODE
35-
- SET_MOP_MODE
36-
- SET_WATER_BOX_CUSTOM_MODE
37-
- RESET_CONSUMABLE
38-
- LOAD_MULTI_MAP
39-
- APP_RC_START
40-
- APP_RC_END
41-
- APP_RC_MOVE
42-
- APP_GOTO_TARGET
43-
- APP_SEGMENT_CLEAN
44-
- APP_ZONED_CLEAN
45-
- APP_GET_DRYER_SETTING
46-
- APP_SET_DRYER_SETTING
47-
- APP_START_WASH
48-
- APP_STOP_WASH
49-
- GET_DUST_COLLECTION_MODE
50-
- SET_DUST_COLLECTION_MODE
51-
- GET_SMART_WASH_PARAMS
52-
- SET_SMART_WASH_PARAMS
53-
- GET_WASH_TOWEL_MODE
54-
- SET_WASH_TOWEL_MODE
55-
- SET_CHILD_LOCK_STATUS
56-
- GET_CHILD_LOCK_STATUS
57-
- START_WASH_THEN_CHARGE
58-
- GET_CURRENT_SOUND
59-
- GET_SERIAL_NUMBER
60-
- GET_TIMEZONE
61-
- GET_SERVER_TIMER
62-
- GET_CUSTOMIZE_CLEAN_MODE
63-
- GET_CLEAN_SEQUENCE
64-
- SET_FDS_ENDPOINT
65-
- ENABLE_LOG_UPLOAD
66-
- APP_WAKEUP_ROBOT
67-
- GET_LED_STATUS
68-
- GET_FLOW_LED_STATUS
69-
- SET_FLOW_LED_STATUS
70-
- GET_SOUND_PROGRESS
71-
- GET_SOUND_VOLUME
72-
- TEST_SOUND_VOLUME
73-
- CHANGE_SOUND_VOLUME
74-
- GET_CARPET_MODE
75-
- SET_CARPET_MODE
76-
- GET_CARPET_CLEAN_MODE
77-
- SET_CARPET_CLEAN_MODE
78-
- UPD_SERVER_TIMER
79-
- SET_SERVER_TIMER
80-
- APP_GET_INIT_STATUS
81-
- SET_APP_TIMEZONE
82-
- GET_NETWORK_INFO
8329

8430
## Credits
8531

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx
2+
3+
sphinx_rtd_theme

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"sphinx.ext.autosummary",
1818
"sphinx.ext.intersphinx",
1919
"sphinx.ext.autosectionlabel",
20+
"sphinx_rtd_theme",
2021
]
2122

2223
intersphinx_mapping = {

docs/source/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Welcome to Roborock's documentation!
77

88
This project is under active development.
99

10+
You can get a Home Assistant integration for Roborock in core
11+
`here <https://www.home-assistant.io/integrations/roborock/>`__ or as a custom integration
12+
`here <https://github.com/humbertogontijo/homeassistant-roborock>`__
13+
1014
Contents
1115
--------
1216

@@ -16,3 +20,4 @@ Contents
1620
status
1721
error
1822
api_commands
23+
supported_devices

docs/source/status.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ Status is a core piece of information for our system. It is used to get a wide v
3434

3535
wash_ready:
3636

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

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

4141
map_status:
4242

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

5959
home_sec_enable_password:
6060

61-
adbumper_status: Optional[
61+
adbumper_status:
6262

6363
water_shortage_status:
6464

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

8787
unsave_map_flag:
88+
89+
wash_status:
90+
91+
distance_off:
92+
93+
in_warmup:
94+
95+
dry_status:
96+
97+
rdt:
98+
99+
clean_percent:
100+
101+
rss:
102+
103+
dss:
104+
105+
common_status:
106+
107+
corner_clean_mode:

docs/source/supported_devices.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Supported Devices
2+
==================
3+
4+
Note: These links are tracking links with Amazon or Roborock. This allows us to get some analytics and helps us get
5+
'negotiation' power with Roborock. We would like to be able to open a channel of communication with Roborock, and
6+
getting information like this is a great first step.
7+
8+
Note, I have only added links to the new devices, older devices are no longer sold directly by roborock, so to buy them
9+
you have to find them used.
10+
11+
.. list-table:: Robot Vacuums
12+
:widths: 30 20 20
13+
:header-rows: 1
14+
15+
* - Vacuum Model
16+
- Amazon
17+
- Roborock
18+
* - Roborock S4
19+
-
20+
-
21+
* - Roborock S4 Max
22+
-
23+
-
24+
* - Roborock S5 Max
25+
-
26+
-
27+
* - Roborock S6
28+
-
29+
-
30+
* - Roborock S6 Pure
31+
-
32+
-
33+
* - Roborock S6 Max
34+
-
35+
-
36+
* - Roborock S6 MaxV
37+
-
38+
-
39+
* - Roborock S7
40+
-
41+
-
42+
* - Roborock S7 MaxV
43+
-
44+
-
45+
* - Roborock S7 Max Ultra
46+
- `Link <https://amzn.to/3GzpXkS>`__
47+
- `Link <https://roborock.pxf.io/c/2522604/1705455/14848>`__
48+
* - Roborock S8
49+
- `Link <https://amzn.to/3GvrF6E>`__
50+
- `Link <https://roborock.pxf.io/9gjZx4>`__
51+
* - Roborock S8 Pro Ultra
52+
- `Link <https://amzn.to/46KgyRX>`__
53+
- `Link <https://roborock.pxf.io/c/2522604/1669165/14848>`__
54+
* - Roborock Q5
55+
- `Link <https://amzn.to/3NjfAoV>`__
56+
- `Link <https://roborock.pxf.io/xkjvby>`__
57+
* - Roborock Q5 Pro
58+
- `Link <https://amzn.to/3uXplTe>`__
59+
- `Link <https://roborock.pxf.io/9gjZQE>`__
60+
* - Roborock Q7
61+
- `Link <https://amzn.to/41bzrMp>`__
62+
- `Link <https://roborock.pxf.io/q4Lvkb>`__
63+
* - Roborock Q7 Max
64+
- `Link <https://amzn.to/4a6GBpt>`__
65+
- `Link <https://roborock.pxf.io/q4Lvkb>`__
66+
* - Roborock Q8 Max
67+
- `Link <https://amzn.to/47QxaJ9>`__
68+
- `Link <https://roborock.pxf.io/jrG42Z>`__
69+
* - Roborock Q Revo
70+
- `Link <https://amzn.to/3Rw9MuB>`__
71+
- `Link <https://roborock.pxf.io/c/2522604/1705456/14848>`__
72+
73+
74+
Roborock has recently added two other categories of devices, handheld vacuums, and washing machines.
75+
Neither are supported at this time.
76+
77+
There are plans to support the handheld ones, but it uses a newer version of the api that I am still trying to reverse
78+
engineer.

0 commit comments

Comments
 (0)