Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for variant of Xiaomi Mi Air Purifier 3C (zhimi.airp.mb4a) #126867

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/xiaomi_miio/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class SetupException(Exception):
MODEL_AIRPURIFIER_2S = "zhimi.airpurifier.mc1"
MODEL_AIRPURIFIER_3 = "zhimi.airpurifier.ma4"
MODEL_AIRPURIFIER_3C = "zhimi.airpurifier.mb4"
MODEL_AIRPURIFIER_3C_REV_A = "zhimi.airp.mb4a"
MODEL_AIRPURIFIER_3H = "zhimi.airpurifier.mb3"
MODEL_AIRPURIFIER_COMPACT = "xiaomi.airp.cpa4"
MODEL_AIRPURIFIER_M1 = "zhimi.airpurifier.m1"
Expand Down Expand Up @@ -126,6 +127,7 @@ class SetupException(Exception):
MODELS_PURIFIER_MIOT = [
MODEL_AIRPURIFIER_3,
MODEL_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_3C_REV_A,
MODEL_AIRPURIFIER_3H,
MODEL_AIRPURIFIER_PROH,
MODEL_AIRPURIFIER_PROH_EU,
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/xiaomi_miio/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
MODEL_AIRPURIFIER_2H,
MODEL_AIRPURIFIER_2S,
MODEL_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_3C_REV_A,
MODEL_AIRPURIFIER_4,
MODEL_AIRPURIFIER_4_LITE_RMA1,
MODEL_AIRPURIFIER_4_LITE_RMB1,
Expand Down Expand Up @@ -215,7 +216,7 @@ async def async_setup_entry(
coordinator = hass.data[DOMAIN][config_entry.entry_id][KEY_COORDINATOR]
device = hass.data[DOMAIN][config_entry.entry_id][KEY_DEVICE]

if model == MODEL_AIRPURIFIER_3C:
if model in (MODEL_AIRPURIFIER_3C, MODEL_AIRPURIFIER_3C_REV_A):
entity = XiaomiAirPurifierMB4(
device,
config_entry,
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/xiaomi_miio/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
MODEL_AIRHUMIDIFIER_CB1,
MODEL_AIRPURIFIER_2S,
MODEL_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_3C_REV_A,
MODEL_AIRPURIFIER_4,
MODEL_AIRPURIFIER_4_LITE_RMA1,
MODEL_AIRPURIFIER_4_LITE_RMB1,
Expand Down Expand Up @@ -244,6 +245,7 @@ class FavoriteLevelValues:
MODEL_AIRHUMIDIFIER_CB1: FEATURE_FLAGS_AIRHUMIDIFIER_CA_AND_CB,
MODEL_AIRPURIFIER_2S: FEATURE_FLAGS_AIRPURIFIER_2S,
MODEL_AIRPURIFIER_3C: FEATURE_FLAGS_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_3C_REV_A: FEATURE_FLAGS_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_PRO: FEATURE_FLAGS_AIRPURIFIER_PRO,
MODEL_AIRPURIFIER_PRO_V7: FEATURE_FLAGS_AIRPURIFIER_PRO_V7,
MODEL_AIRPURIFIER_V1: FEATURE_FLAGS_AIRPURIFIER_V1,
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/xiaomi_miio/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
MODEL_AIRHUMIDIFIER_CA1,
MODEL_AIRHUMIDIFIER_CB1,
MODEL_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_3C_REV_A,
MODEL_AIRPURIFIER_4,
MODEL_AIRPURIFIER_4_LITE_RMA1,
MODEL_AIRPURIFIER_4_LITE_RMB1,
Expand Down Expand Up @@ -560,6 +561,7 @@ class XiaomiMiioSensorDescription(SensorEntityDescription):
MODEL_AIRHUMIDIFIER_CA1: HUMIDIFIER_CA1_CB1_SENSORS,
MODEL_AIRHUMIDIFIER_CB1: HUMIDIFIER_CA1_CB1_SENSORS,
MODEL_AIRPURIFIER_3C: PURIFIER_3C_SENSORS,
MODEL_AIRPURIFIER_3C_REV_A: PURIFIER_3C_SENSORS,
MODEL_AIRPURIFIER_4_LITE_RMA1: PURIFIER_4_LITE_SENSORS,
MODEL_AIRPURIFIER_4_LITE_RMB1: PURIFIER_4_LITE_SENSORS,
MODEL_AIRPURIFIER_4: PURIFIER_4_SENSORS,
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/xiaomi_miio/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
MODEL_AIRPURIFIER_2H,
MODEL_AIRPURIFIER_2S,
MODEL_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_3C_REV_A,
MODEL_AIRPURIFIER_4,
MODEL_AIRPURIFIER_4_LITE_RMA1,
MODEL_AIRPURIFIER_4_LITE_RMB1,
Expand Down Expand Up @@ -199,6 +200,7 @@
MODEL_AIRPURIFIER_2H: FEATURE_FLAGS_AIRPURIFIER_2S,
MODEL_AIRPURIFIER_2S: FEATURE_FLAGS_AIRPURIFIER_2S,
MODEL_AIRPURIFIER_3C: FEATURE_FLAGS_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_3C_REV_A: FEATURE_FLAGS_AIRPURIFIER_3C,
MODEL_AIRPURIFIER_PRO: FEATURE_FLAGS_AIRPURIFIER_PRO,
MODEL_AIRPURIFIER_PRO_V7: FEATURE_FLAGS_AIRPURIFIER_PRO_V7,
MODEL_AIRPURIFIER_V1: FEATURE_FLAGS_AIRPURIFIER_V1,
Expand Down
Loading