Skip to content

Commit

Permalink
Merge branch 'release/2024.7.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Aug 8, 2024
2 parents d15565a + f92ffc6 commit 946f868
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ This custom component is more or less the beta version of the [official componen
| Smartmi Evaporative Humidifier (Korea Version) | zhimi.humidifier.cb2 | CJXJSQ02ZM | 8W, 240x240x363mm |
| Mijia Smart Sterilization Humidifier S | deerma.humidifier.mjjsq | MJJSQ03DY | 4.5L, <=39dB, 450mL/h, 40W |
| Mijia Intelligent Sterilization Humidifier (EU version?) | deerma.humidifier.jsq | ZNJSQ01DEM | 4.5L, <=38dB, 300mL/h, 24W |
| Mijia Smart Humidifier 2 (EU version) | deerma.humidifier.jsq2w | MJJSQ05DY | 4.5L, <=32dB, 300mL/h, 28 W |
| Mijia Humidifier 4L | deerma.humidifier.jsq3 | MJJSQ04DY | 4L, <=38dB, 300mL/h, 25W |
| Mijia Intelligent Sterilization Humidifier (EU version?) | deerma.humidifier.jsq5 | ZNJSQ01DEM | 4.5L, <=38dB, 300mL/h, 24W |
| Mijia Smart Sterilization Humidifier S (EU version?) | deerma.humidifier.jsqs | MJJSQ03DY | 4.5L, <=39dB, 450mL/h, 40W |
Expand Down
22 changes: 11 additions & 11 deletions custom_components/xiaomi_miio_airpurifier/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,8 @@

from homeassistant.components.fan import (
PLATFORM_SCHEMA,
SUPPORT_DIRECTION,
SUPPORT_OSCILLATE,
SUPPORT_PRESET_MODE,
SUPPORT_SET_SPEED,
FanEntity,
FanEntityFeature
)
from homeassistant.const import (
ATTR_ENTITY_ID,
Expand Down Expand Up @@ -135,6 +132,7 @@
MODEL_AIRHUMIDIFIER_MJJSQ = "deerma.humidifier.mjjsq"
MODEL_AIRHUMIDIFIER_JSQ = "deerma.humidifier.jsq"
MODEL_AIRHUMIDIFIER_JSQ1 = "deerma.humidifier.jsq1"
MODEL_AIRHUMIDIFIER_JSQ2W = "deerma.humidifier.jsq2w"
MODEL_AIRHUMIDIFIER_JSQ3 = "deerma.humidifier.jsq3"
MODEL_AIRHUMIDIFIER_JSQ5 = "deerma.humidifier.jsq5"
MODEL_AIRHUMIDIFIER_JSQS = "deerma.humidifier.jsqs"
Expand Down Expand Up @@ -195,6 +193,7 @@
MODEL_AIRHUMIDIFIER_MJJSQ,
MODEL_AIRHUMIDIFIER_JSQ,
MODEL_AIRHUMIDIFIER_JSQ1,
MODEL_AIRHUMIDIFIER_JSQ2W,
MODEL_AIRHUMIDIFIER_JSQ3,
MODEL_AIRHUMIDIFIER_JSQ5,
MODEL_AIRHUMIDIFIER_JSQS,
Expand Down Expand Up @@ -1148,6 +1147,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
air_humidifier = AirHumidifierMjjsq(host, token, model=model)
device = XiaomiAirHumidifierMjjsq(name, air_humidifier, model, unique_id)
elif model in [
MODEL_AIRHUMIDIFIER_JSQ2W,
MODEL_AIRHUMIDIFIER_JSQ3,
MODEL_AIRHUMIDIFIER_JSQ5,
MODEL_AIRHUMIDIFIER_JSQS,
Expand Down Expand Up @@ -1266,7 +1266,7 @@ def __init__(self, name, device, model, unique_id, retries=0):
@property
def supported_features(self):
"""Flag supported features."""
return SUPPORT_PRESET_MODE
return FanEntityFeature.PRESET_MODE

@property
def should_poll(self):
Expand Down Expand Up @@ -2396,10 +2396,10 @@ def __init__(self, name, device, model, unique_id, retries):
def supported_features(self) -> int:
"""Supported features."""
return (
SUPPORT_SET_SPEED
| SUPPORT_PRESET_MODE
| SUPPORT_OSCILLATE
| SUPPORT_DIRECTION
FanEntityFeature.SET_SPEED
| FanEntityFeature.PRESET_MODE
| FanEntityFeature.OSCILLATE
| FanEntityFeature.DIRECTION
)

async def async_update(self):
Expand Down Expand Up @@ -2749,7 +2749,7 @@ def __init__(self, name, device, model, unique_id, retries):
@property
def supported_features(self) -> int:
"""Supported features."""
return SUPPORT_SET_SPEED | SUPPORT_PRESET_MODE | SUPPORT_OSCILLATE
return FanEntityFeature.SET_SPEED | FanEntityFeature.PRESET_MODE | FanEntityFeature.OSCILLATE

async def async_update(self):
"""Fetch state from the device."""
Expand Down Expand Up @@ -2882,7 +2882,7 @@ def __init__(self, name, device, model, unique_id, retries):
@property
def supported_features(self) -> int:
"""Supported features."""
return SUPPORT_SET_SPEED | SUPPORT_PRESET_MODE | SUPPORT_OSCILLATE
return FanEntityFeature.SET_SPEED | FanEntityFeature.PRESET_MODE | FanEntityFeature.OSCILLATE

async def async_update(self):
"""Fetch state from the device."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/xiaomi_miio_airpurifier/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"construct==2.10.68",
"python-miio>=0.5.12"
],
"version": "2023.12.0.0"
"version": "2024.7.0.0"
}

0 comments on commit 946f868

Please sign in to comment.