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

Added support for Xiaomi Smart Space Heater 1S (zhimi.heater.mc2a) #1868

Merged
merged 5 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
16 changes: 16 additions & 0 deletions miio/integrations/dmaker/fan/fan_miot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class MoveDirection(enum.Enum):
MODEL_FAN_P15 = "dmaker.fan.p15"
MODEL_FAN_P18 = "dmaker.fan.p18"
MODEL_FAN_P33 = "dmaker.fan.p33"
MODEL_FAN_P39 = "dmaker.fan.p39"
MODEL_FAN_P45 = "dmaker.fan.p45"
MODEL_FAN_1C = "dmaker.fan.1c"

Expand Down Expand Up @@ -87,6 +88,20 @@ class MoveDirection(enum.Enum):
"power_off_time": {"siid": 3, "piid": 1},
"set_move": {"siid": 6, "piid": 1},
},
MODEL_FAN_P39: {
# https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:dmaker-p39:1
"power": {"siid": 2, "piid": 1},
"fan_level": {"siid": 2, "piid": 2},
"mode": {"siid": 2, "piid": 4},
"swing_mode": {"siid": 2, "piid": 5},
"swing_mode_angle": {"siid": 2, "piid": 6},
"power_off_time": {"siid": 2, "piid": 8},
"set_move": {"siid": 2, "piid": 10},
"fan_speed": {"siid": 2, "piid": 11},
"child_lock": {"siid": 3, "piid": 1},
"buzzer": {"siid": 2, "piid": 7},
"light": {"siid": 2, "piid": 9},
},
MODEL_FAN_P45: {
# Source https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:dmaker-p45:1
"power": {"siid": 2, "piid": 1},
Expand Down Expand Up @@ -129,6 +144,7 @@ class MoveDirection(enum.Enum):
MODEL_FAN_P15: [30, 60, 90, 120, 140], # mapped to P11
MODEL_FAN_P18: [30, 60, 90, 120, 140], # mapped to P10
MODEL_FAN_P33: [30, 60, 90, 120, 140],
MODEL_FAN_P39: [30, 60, 90, 120, 140],
MODEL_FAN_P45: [30, 60, 90, 120, 150],
}

Expand Down
20 changes: 20 additions & 0 deletions miio/integrations/zhimi/heater/heater_miot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
# Indicator light (siid=7)
"led_brightness": {"siid": 7, "piid": 3},
},
"zhimi.heater.mc2a": {
# Source https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:heater:0000A01A:zhimi-mc2a:1
# Heater (siid=2)
"power": {"siid": 2, "piid": 1},
"target_temperature": {"siid": 2, "piid": 5},
# Countdown (siid=3)
"countdown_time": {"siid": 3, "piid": 1},
# Environment (siid=4)
"temperature": {"siid": 4, "piid": 7},
# Physical Control Locked (siid=5)
"child_lock": {"siid": 5, "piid": 1},
# Alarm (siid=6)
"buzzer": {"siid": 6, "piid": 1},
# Indicator light (siid=7)
"led_brightness": {"siid": 7, "piid": 3},
},
"zhimi.heater.za2": {
# Source https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:heater:0000A01A:zhimi-za2:1
# Heater (siid=2)
Expand Down Expand Up @@ -65,6 +81,10 @@
"temperature_range": (18, 28),
"delay_off_range": (0, 12 * 3600),
},
"zhimi.heater.mc2a": {
"temperature_range": (18, 28),
"delay_off_range": (0, 12 * 3600),
},
"zhimi.heater.za2": {
"temperature_range": (16, 28),
"delay_off_range": (0, 8 * 3600),
Expand Down