mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-17 07:10:44 +08:00
Compare commits
5 Commits
3525a06ba4
...
9711a6d683
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9711a6d683 | ||
|
|
c04fa542a3 | ||
|
|
1258d3f3d3 | ||
|
|
64d9d54170 | ||
|
|
059eee33e0 |
16
CHANGELOG.md
16
CHANGELOG.md
@ -1,10 +1,24 @@
|
||||
# CHANGELOG
|
||||
## v0.4.3
|
||||
### Changed
|
||||
- Remove `VacuumEntityFeature.BATTERY` from the vacuum entity. [#1433](https://github.com/XiaoMi/ha_xiaomi_home/pull/1433)
|
||||
- Subscribe the proxy gateway child device up messages even though the device is offline. [#1393](https://github.com/XiaoMi/ha_xiaomi_home/pull/1393)
|
||||
### Fixed
|
||||
- Fix the integer value step. [#1388](https://github.com/XiaoMi/ha_xiaomi_home/pull/1388)
|
||||
- Fix the contact-state property value format. [#1387](https://github.com/XiaoMi/ha_xiaomi_home/pull/1387)
|
||||
- Fix the MIoT-Spec-V2 of xiaomi.airc.rr0r00 swing mode and hyd.airer.lyjpro current-position. [#1394](https://github.com/XiaoMi/ha_xiaomi_home/pull/1394)
|
||||
- Fix roidmi.vacuum.v60 siid=2 aiid=3 out field format.
|
||||
- Ignore unsupported properties of xiaomi.wifispeaker.l15a and 759413.aircondition.iez.
|
||||
- Add an alongside button entity for xiaomi.wifispeaker.l05b play action.
|
||||
- Add zhimi.fan.za1 fan mode description in zh_Hans.
|
||||
- Fix the error reported by pylint-4.0.0. [#1455](https://github.com/XiaoMi/ha_xiaomi_home/pull/1455)
|
||||
|
||||
## v0.4.2
|
||||
### Changed
|
||||
- Set the battery service's start-charge action as the fallback action to support RETURN_HOME feature of the vacuum entity. [#1344](https://github.com/XiaoMi/ha_xiaomi_home/pull/1344)
|
||||
### Fixed
|
||||
- Correct the property value format after expression calculation. [#1366](https://github.com/XiaoMi/ha_xiaomi_home/pull/1366)
|
||||
- Fix the MIoT-Spec-V2 of fix: xiaomi.fan.p70 and fix: xiaomi.fan.p76 fan level, xiaomi.airc.rr0r00 and xiaomi.airc.h43h00 humidity-range, and zhimi.humidifier.ca4 water level. [#1367](https://github.com/XiaoMi/ha_xiaomi_home/pull/1367)
|
||||
- Fix the MIoT-Spec-V2 of xiaomi.fan.p70 and xiaomi.fan.p76 fan level, xiaomi.airc.rr0r00 and xiaomi.airc.h43h00 humidity-range, and zhimi.humidifier.ca4 water level. [#1367](https://github.com/XiaoMi/ha_xiaomi_home/pull/1367)
|
||||
- Ignore the unsupported model hmpace.motion.v6nfc.
|
||||
- Delete all unsupported MIoT-Spec-V2 instances of narwa.vacuum.001 and narwa.vacuum.ax11. [#1355](https://github.com/XiaoMi/ha_xiaomi_home/pull/1355)
|
||||
|
||||
|
||||
@ -224,6 +224,15 @@ class FeatureFanMode(MIoTServiceEntity, ClimateEntity):
|
||||
_prop_fan_level: Optional[MIoTSpecProperty]
|
||||
_fan_mode_map: Optional[dict[int, str]]
|
||||
|
||||
# HomeKit Bridge: fan_modes must be "auto"、"low"、"medium"、"high"
|
||||
_fan_mode_translation_map = {
|
||||
"自动": "auto",
|
||||
"低风": "low",
|
||||
"中风": "medium",
|
||||
"高风": "high",
|
||||
}
|
||||
_fan_mode_translation_map_rev = {v: k for k, v in _fan_mode_translation_map.items()}
|
||||
|
||||
def __init__(self, miot_device: MIoTDevice,
|
||||
entity_data: MIoTEntityData) -> None:
|
||||
"""Initialize the feature class."""
|
||||
@ -243,7 +252,13 @@ class FeatureFanMode(MIoTServiceEntity, ClimateEntity):
|
||||
self.entity_id)
|
||||
continue
|
||||
self._fan_mode_map = prop.value_list.to_map()
|
||||
self._attr_fan_modes = prop.value_list.descriptions
|
||||
# save org fan speed
|
||||
self._raw_fan_modes = prop.value_list.descriptions
|
||||
self._attr_fan_modes = [
|
||||
self._fan_mode_translation_map.get(mode, mode)
|
||||
for mode in self._raw_fan_modes
|
||||
]
|
||||
|
||||
self._attr_supported_features |= ClimateEntityFeature.FAN_MODE
|
||||
self._prop_fan_level = prop
|
||||
elif prop.name == 'on' and prop.service.name == 'fan-control':
|
||||
@ -264,7 +279,11 @@ class FeatureFanMode(MIoTServiceEntity, ClimateEntity):
|
||||
if fan_mode == FAN_ON:
|
||||
await self.set_property_async(prop=self._prop_fan_on, value=True)
|
||||
return
|
||||
mode_value = self.get_map_key(map_=self._fan_mode_map, value=fan_mode)
|
||||
|
||||
chinese_fan_mode = self._fan_mode_translation_map_rev.get(fan_mode, fan_mode)
|
||||
|
||||
mode_value = self.get_map_key(map_=self._fan_mode_map, value=chinese_fan_mode)
|
||||
|
||||
if mode_value is None or not await self.set_property_async(
|
||||
prop=self._prop_fan_level, value=mode_value):
|
||||
raise RuntimeError(f'set climate prop.fan_mode failed, {fan_mode}, '
|
||||
@ -278,9 +297,15 @@ class FeatureFanMode(MIoTServiceEntity, ClimateEntity):
|
||||
if self._prop_fan_level is None and self._prop_fan_on:
|
||||
return (FAN_ON if self.get_prop_value(
|
||||
prop=self._prop_fan_on) else FAN_OFF)
|
||||
return self.get_map_value(
|
||||
|
||||
current_chinese_mode = self.get_map_value(
|
||||
map_=self._fan_mode_map,
|
||||
key=self.get_prop_value(prop=self._prop_fan_level))
|
||||
|
||||
if current_chinese_mode is None:
|
||||
return None
|
||||
|
||||
return self._fan_mode_translation_map.get(current_chinese_mode, current_chinese_mode)
|
||||
|
||||
|
||||
class FeatureSwingMode(MIoTServiceEntity, ClimateEntity):
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
"cryptography",
|
||||
"psutil"
|
||||
],
|
||||
"version": "v0.4.2",
|
||||
"version": "v0.4.3",
|
||||
"zeroconf": [
|
||||
"_miot-central._tcp.local."
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user