Skip to content

Commit

Permalink
Add support for zhimi.humidifier.ca4 (miot) (rytilahti#772)
Browse files Browse the repository at this point in the history
* Added minimal functionality for work air humidifier via miot for zhimi.humidifier.ca4

* Implemented all features of air humidifier miot

* Added tests for air humidifier miot

* Airhumidifier_miot added divided by 1.25 for water level for providing percentage of the level

* airhumidifier miot added and updated tests

* Added miio.airhumidifier_miot to docs

* AirHumidifier_Miot. Changed to consistent naming of methods for homeAssistant and other modules

* miio/airhumidifier_miot.py Remove the duplicate docstring.

Co-authored-by: Teemu R. <tpr@iki.fi>

* Update miio/airhumidifier_miot.py

Co-authored-by: Teemu R. <tpr@iki.fi>

* Added Xiaomi Mi Air Humidifier CA4 to Readme

* AirHumidifierMiot. State fault -> error. Consistent in desc of properties. Added Logger for catch branch. Updated tests

Co-authored-by: Teemu R. <tpr@iki.fi>
  • Loading branch information
2 people authored and xvlady committed May 9, 2021
1 parent 12b991e commit 239c558
Show file tree
Hide file tree
Showing 5 changed files with 569 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For example, executing it without any extra arguments will print out options and
You can get some information from any miIO/miOT device, including its device model, using the `info` command::

miiocli device --ip <ip> --token <token> info

Model: some.device.model1
Hardware version: esp8285
Firmware version: 1.0.1_0012
Expand All @@ -42,7 +42,7 @@ Each different device type is supported by their corresponding module (e.g., `va
You can get the list of available commands for any given module by passing `--help` argument to it::

$ miiocli vacuum --help

Usage: miiocli vacuum [OPTIONS] COMMAND [ARGS]...

Options:
Expand All @@ -60,11 +60,12 @@ API usage
All functionality is accessible through the `miio` module::

from miio import Vacuum

vac = Vacuum("<ip address>", "<token>")
vac.start()
Each separate device type inherits from `miio.Device` (and in case of miOT devices, `miio.MiotDevice`) which provides common API.

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

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

Expand Down Expand Up @@ -105,7 +106,7 @@ Supported devices
- Xiaomi Philips Zhirui Bedroom Smart Lamp
- Xiaomi Universal IR Remote Controller (Chuangmi IR)
- Xiaomi Mi Smart Pedestal Fan V2, V3, SA1, ZA1, ZA3, ZA4, P5
- Xiaomi Mi Air Humidifier V1, CA1, CB1, MJJSQ, JSQ001
- Xiaomi Mi Air Humidifier V1, CA1, CA4, CB1, MJJSQ, JSQ001
- Xiaomi Mi Water Purifier (Basic support: Turn on & off)
- Xiaomi PM2.5 Air Quality Monitor V1, B1, S1
- Xiaomi Smart WiFi Speaker
Expand Down
7 changes: 7 additions & 0 deletions docs/api/miio.airhumidifier_miot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
miio.airhumidifier\_miot module
===============================

.. automodule:: miio.airhumidifier_miot
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions miio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from miio.airfresh_t2017 import AirFreshT2017
from miio.airhumidifier import AirHumidifier, AirHumidifierCA1, AirHumidifierCB1
from miio.airhumidifier_jsq import AirHumidifierJsq
from miio.airhumidifier_miot import AirHumidifierMiot
from miio.airhumidifier_mjjsq import AirHumidifierMjjsq
from miio.airpurifier import AirPurifier
from miio.airpurifier_miot import AirPurifierMiot
Expand Down
Loading

0 comments on commit 239c558

Please sign in to comment.