Skip to content

Commit

Permalink
Add examples how to avoid model autodetection
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Sep 17, 2021
1 parent f5a344f commit 0845bb8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ You can get the list of available commands for any given module by passing `--he
add_timer Add a timer.
..

Each command invocation will automatically detect the device model necessary for some actions by querying the device.
You can avoid this by specifying the model manually::

miiocli vacuum --model roborock.vacuum.s5 --ip <ip> --token <token> start


API usage
---------
All functionality is accessible through the `miio` module::
Expand All @@ -65,7 +71,15 @@ All functionality is accessible through the `miio` module::
vac.start()

Each separate device type inherits from `miio.Device`
(and in case of MIoT devices, `miio.MiotDevice`) which provides common API.
(and in case of MIoT devices, `miio.MiotDevice`) which provides a common API.

Each command invocation will automatically detect (and cache) the device model necessary for some actions
by querying the device.
You can avoid this by specifying the model manually::

from miio import Vacuum

vac = Vacuum("<ip address>", "<token>", model="roborock.vacuum.s5")

Please refer to `API documentation <https://python-miio.readthedocs.io/en/latest/api/miio.html>`__ for more information.

Expand Down Expand Up @@ -175,7 +189,8 @@ Home Assistant (custom)
Other related projects
----------------------

This is a list of other projects around the xiaomi ecosystem that you can find interesting. Feel free to submit more related projects.
This is a list of other projects around the xiaomi ecosystem that you can find interesting.
Feel free to submit more related projects.

- `dustcloud <https://github.com/dgiese/dustcloud>`__ (reverse engineering and rooting xiaomi devices)
- `Valetudo <https://github.com/Hypfer/Valetudo>`__ (cloud free vacuum firmware)
Expand Down

0 comments on commit 0845bb8

Please sign in to comment.