Skip to content

Commit

Permalink
Adding support for Mi AirPurifier 3H
Browse files Browse the repository at this point in the history
  • Loading branch information
foxel committed Feb 19, 2020
1 parent 9cd4464 commit 65c2f15
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions homeassistant/components/xiaomi_miio/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
MODEL_AIRPURIFIER_SA2 = "zhimi.airpurifier.sa2"
MODEL_AIRPURIFIER_2S = "zhimi.airpurifier.mc1"
MODEL_AIRPURIFIER_3 = "zhimi.airpurifier.ma4"
MODEL_AIRPURIFIER_3H = "zhimi.airpurifier.mb3"

MODEL_AIRHUMIDIFIER_V1 = "zhimi.humidifier.v1"
MODEL_AIRHUMIDIFIER_CA1 = "zhimi.humidifier.ca1"
Expand Down Expand Up @@ -111,6 +112,7 @@
MODEL_AIRPURIFIER_SA2,
MODEL_AIRPURIFIER_2S,
MODEL_AIRPURIFIER_3,
MODEL_AIRPURIFIER_3H,
MODEL_AIRHUMIDIFIER_V1,
MODEL_AIRHUMIDIFIER_CA1,
MODEL_AIRHUMIDIFIER_CB1,
Expand Down Expand Up @@ -162,14 +164,14 @@
ATTR_HARDWARE_VERSION = "hardware_version"

# Air Humidifier CA
ATTR_MOTOR_SPEED = "motor_speed"
# ATTR_MOTOR_SPEED = "motor_speed"
ATTR_DEPTH = "depth"
ATTR_DRY = "dry"

# Air Fresh
ATTR_CO2 = "co2"

PURIFIER_MIOT = [MODEL_AIRPURIFIER_3]
PURIFIER_MIOT = [MODEL_AIRPURIFIER_3, MODEL_AIRPURIFIER_3H]

# Map attributes to properties of the state object
AVAILABLE_ATTRIBUTES_AIRPURIFIER_COMMON = {
Expand Down Expand Up @@ -399,6 +401,7 @@
| FEATURE_SET_CHILD_LOCK
| FEATURE_SET_LED
| FEATURE_SET_FAVORITE_LEVEL
| FEATURE_SET_LED_BRIGHTNESS
)

FEATURE_FLAGS_AIRPURIFIER_V3 = (
Expand Down Expand Up @@ -733,7 +736,7 @@ def __init__(self, name, device, model, unique_id):
self._device_features = FEATURE_FLAGS_AIRPURIFIER_2S
self._available_attributes = AVAILABLE_ATTRIBUTES_AIRPURIFIER_2S
self._speed_list = OPERATION_MODES_AIRPURIFIER_2S
elif self._model == MODEL_AIRPURIFIER_3:
elif self._model == MODEL_AIRPURIFIER_3 or self._model == MODEL_AIRPURIFIER_3H:
self._device_features = FEATURE_FLAGS_AIRPURIFIER_3
self._available_attributes = AVAILABLE_ATTRIBUTES_AIRPURIFIER_3
self._speed_list = OPERATION_MODES_AIRPURIFIER_3
Expand Down

0 comments on commit 65c2f15

Please sign in to comment.