mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-18 16:10:44 +08:00
Compare commits
6 Commits
f59138e85c
...
b6540ad16e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6540ad16e | ||
|
|
7abc20dcb5 | ||
|
|
3e33804477 | ||
|
|
1258d3f3d3 | ||
|
|
64d9d54170 | ||
|
|
059eee33e0 |
@ -1,4 +1,13 @@
|
||||
# CHANGELOG
|
||||
## v0.4.4
|
||||
### Added
|
||||
- Add Turkish language support. [#1468](https://github.com/XiaoMi/ha_xiaomi_home/pull/1468)
|
||||
### Fixed
|
||||
- Stop MQTT internal loop immediately when main loop is closed. [#1465](https://github.com/XiaoMi/ha_xiaomi_home/pull/1465)
|
||||
- Fix the float value precision. [#1485](https://github.com/XiaoMi/ha_xiaomi_home/pull/1485)
|
||||
- Fix the climate entity swing mode setting. [#1486](https://github.com/XiaoMi/ha_xiaomi_home/pull/1486)
|
||||
- Fix the MIoT-Spec-V2 of cykj.hood.jyj22 urn version 4, lumi.motion.bmgl01 siid=2 piid=2 value-list, ykcn.valve.cbcs power property value unit, ainice.sensor_occupy.3b people-number property and qdhkl.airc.a42 hvac mode. [#1496](https://github.com/XiaoMi/ha_xiaomi_home/pull/1496)
|
||||
|
||||
## v0.4.3
|
||||
### Changed
|
||||
- Remove `VacuumEntityFeature.BATTERY` from the vacuum entity. [#1433](https://github.com/XiaoMi/ha_xiaomi_home/pull/1433)
|
||||
|
||||
@ -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):
|
||||
@ -529,6 +554,8 @@ class AirConditioner(FeatureOnOff, FeatureTargetTemperature,
|
||||
self._hvac_mode_map[item.value] = HVACMode.DRY
|
||||
elif item.name in {'fan'}:
|
||||
self._hvac_mode_map[item.value] = HVACMode.FAN_ONLY
|
||||
elif item.name in {'heat_cool'}:
|
||||
self._hvac_mode_map[item.value] = HVACMode.HEAT_COOL
|
||||
self._attr_hvac_modes = list(self._hvac_mode_map.values())
|
||||
self._prop_mode = prop
|
||||
elif prop.name == 'ac-state':
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
"cryptography",
|
||||
"psutil"
|
||||
],
|
||||
"version": "v0.4.3",
|
||||
"version": "v0.4.4",
|
||||
"zeroconf": [
|
||||
"_miot-central._tcp.local."
|
||||
]
|
||||
|
||||
@ -747,6 +747,7 @@ class MIoTDevice:
|
||||
'watt': UnitOfPower.WATT,
|
||||
'w': UnitOfPower.WATT,
|
||||
'W': UnitOfPower.WATT,
|
||||
'kW': UnitOfPower.KILO_WATT,
|
||||
'kWh': UnitOfEnergy.KILO_WATT_HOUR,
|
||||
'A': UnitOfElectricCurrent.AMPERE,
|
||||
'mA': UnitOfElectricCurrent.MILLIAMPERE,
|
||||
|
||||
@ -5,6 +5,12 @@
|
||||
"service:003:property:001:valuelist:001": "Dry"
|
||||
}
|
||||
},
|
||||
"urn:miot-spec-v2:device:electronic-valve:0000A0A7:ykcn-cbcs": {
|
||||
"zh-Hans": {
|
||||
"service:004:property:001": "功率过高-阈值设置",
|
||||
"service:004:property:009": "欠压告警-阈值设置"
|
||||
}
|
||||
},
|
||||
"urn:miot-spec-v2:device:fan:0000A005:zhimi-za1": {
|
||||
"zh-Hans": {
|
||||
"service:002:property:005:valuelist:000": "自然风",
|
||||
|
||||
@ -1679,7 +1679,7 @@
|
||||
"urn:miot-spec-v2:device:vacuum:0000A006:roidmi-v60:3": [
|
||||
{
|
||||
"iid": 2,
|
||||
"type": "urn:miot-spec-v2:service:vacuum:00007810:roidmi-v60:1",
|
||||
"type": "urn:miot-spec-v2:service:cleaner:00007810:roidmi-v60:1",
|
||||
"description": "Robot Cleaner",
|
||||
"actions": [
|
||||
{
|
||||
|
||||
@ -1,6 +1,21 @@
|
||||
urn:miot-spec-v2:device:air-condition-outlet:0000A045:lumi-mcn04:1:
|
||||
prop.3.4:
|
||||
format: uint8
|
||||
urn:miot-spec-v2:device:air-conditioner:0000A004:qdhkl-a42:1:
|
||||
prop.2.2:
|
||||
value-list:
|
||||
- value: 1
|
||||
description: Cool
|
||||
- value: 2
|
||||
description: Dry
|
||||
- value: 4
|
||||
description: Fan
|
||||
- value: 8
|
||||
description: Heat
|
||||
- value: 9
|
||||
description: Auto
|
||||
- value: 10
|
||||
description: Heat_cool
|
||||
urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-c17:1:
|
||||
prop.10.6:
|
||||
unit: none
|
||||
@ -125,11 +140,45 @@ urn:miot-spec-v2:device:curtain:0000A00C:bjkcz-kczble:1:0000D031:
|
||||
name: status-a
|
||||
urn:miot-spec-v2:device:electronic-valve:0000A0A7:sanmei-s1:1:
|
||||
prop.3.1:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 99999999
|
||||
- 0.01
|
||||
expr: round(src_value/100, 2)
|
||||
prop.3.2:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 16777216
|
||||
- 0.01
|
||||
expr: round(src_value/100, 2)
|
||||
prop.3.3:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 65535
|
||||
- 0.1
|
||||
expr: round(src_value/10, 1)
|
||||
urn:miot-spec-v2:device:electronic-valve:0000A0A7:ykcn-cbcs:1:0000C833:
|
||||
prop.3.1:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 99999999
|
||||
- 0.01
|
||||
expr: round(src_value/100, 2)
|
||||
prop.3.2:
|
||||
unit: mA
|
||||
prop.3.3:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 65535
|
||||
- 0.1
|
||||
expr: round(src_value/10, 1)
|
||||
prop.4.1:
|
||||
unit: kW
|
||||
urn:miot-spec-v2:device:fan:0000A005:dmaker-p33:1:
|
||||
prop.2.2:
|
||||
name: fan-level-a
|
||||
@ -205,6 +254,7 @@ urn:miot-spec-v2:device:hood:0000A01B:cykj-jyj22:2: urn:miot-spec-v2:device:hood
|
||||
urn:miot-spec-v2:device:hood:0000A01B:cykj-jyj22:3:
|
||||
prop.3.1:
|
||||
name: on-ventilation
|
||||
urn:miot-spec-v2:device:hood:0000A01B:cykj-jyj22:4: urn:miot-spec-v2:device:hood:0000A01B:cykj-jyj22:3
|
||||
urn:miot-spec-v2:device:humidifier:0000A00E:zhimi-ca4:2:
|
||||
prop.2.7:
|
||||
unit: percentage
|
||||
@ -236,13 +286,30 @@ urn:miot-spec-v2:device:motion-sensor:0000A014:lumi-acn001:1:
|
||||
- read
|
||||
- notify
|
||||
unit: mV
|
||||
urn:miot-spec-v2:device:motion-sensor:0000A014:lumi-bmgl01:1:
|
||||
prop.2.2:
|
||||
value-list:
|
||||
- value: 0
|
||||
description: 0 Seconds
|
||||
- value: 2
|
||||
description: 2 Minutes
|
||||
- value: 5
|
||||
description: 5 Minutes
|
||||
urn:miot-spec-v2:device:motor-controller:0000A01D:adp-adswb4:1:0000C837:
|
||||
prop.2.1:
|
||||
name: motor-switch
|
||||
urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:ainice-3b:1: urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:ainice-3b:2
|
||||
urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:ainice-3b:2:
|
||||
prop.2.5:
|
||||
name: people-number
|
||||
prop.2.8:
|
||||
name: people-number
|
||||
prop.2.11:
|
||||
name: people-number
|
||||
prop.2.14:
|
||||
name: people-number
|
||||
prop.2.17:
|
||||
name: people-number
|
||||
urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:izq-24:2:0000C824:
|
||||
prop.2.6:
|
||||
unit: cm
|
||||
@ -253,29 +320,57 @@ urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:1: urn:miot-spec-v2:devi
|
||||
urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:2: urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3
|
||||
urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:3:
|
||||
prop.5.1:
|
||||
expr: round(src_value*6/1000000, 3)
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 65535
|
||||
- 0.01
|
||||
expr: round(src_value*6/1000000, 2)
|
||||
urn:miot-spec-v2:device:outlet:0000A002:cuco-cp1md:1:
|
||||
prop.2.2:
|
||||
name: power-consumption
|
||||
expr: round(src_value/1000, 3)
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 65535
|
||||
- 0.01
|
||||
expr: round(src_value/1000, 2)
|
||||
prop.2.3:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 3000
|
||||
- 0.1
|
||||
expr: round(src_value/10, 1)
|
||||
prop.2.4:
|
||||
unit: mA
|
||||
urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:1: urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:2
|
||||
urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2:2:
|
||||
prop.2.3:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 3000
|
||||
- 0.1
|
||||
expr: round(src_value/10, 1)
|
||||
prop.2.4:
|
||||
unit: mA
|
||||
prop.3.2:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 65535
|
||||
- 0.1
|
||||
expr: round(src_value/10, 1)
|
||||
urn:miot-spec-v2:device:outlet:0000A002:cuco-cp2d:1:
|
||||
prop.3.2:
|
||||
expr: round(src_value/1000, 2)
|
||||
unit: mA
|
||||
urn:miot-spec-v2:device:outlet:0000A002:cuco-v3:1:
|
||||
prop.11.1:
|
||||
name: power-consumption
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 65535
|
||||
- 0.01
|
||||
expr: round(src_value/100, 2)
|
||||
urn:miot-spec-v2:device:outlet:0000A002:cuco-v3:2: urn:miot-spec-v2:device:outlet:0000A002:cuco-v3:1
|
||||
urn:miot-spec-v2:device:outlet:0000A002:giot-v8icm:1:0000C816:
|
||||
@ -288,11 +383,20 @@ urn:miot-spec-v2:device:outlet:0000A002:qmi-psv3:1:0000C816:
|
||||
unit: mA
|
||||
urn:miot-spec-v2:device:outlet:0000A002:yutai-fsov8m:1:0000C816:
|
||||
prop.4.1:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 429497
|
||||
- 0.01
|
||||
expr: round(src_value/10000, 2)
|
||||
urn:miot-spec-v2:device:outlet:0000A002:zimi-zncz01:1:0000C816: urn:miot-spec-v2:device:outlet:0000A002:zimi-zncz01:2:0000C816
|
||||
urn:miot-spec-v2:device:outlet:0000A002:zimi-zncz01:2:0000C816:
|
||||
prop.3.1:
|
||||
name: electric-power
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 350000
|
||||
- 0.01
|
||||
expr: round(src_value/100, 2)
|
||||
urn:miot-spec-v2:device:plant-monitor:0000A030:hhcc-v1:1:
|
||||
prop.2.1:
|
||||
@ -325,10 +429,20 @@ urn:miot-spec-v2:device:switch:0000A003:090615-x1tpm:1:0000D042:
|
||||
name: light-fan-on
|
||||
urn:miot-spec-v2:device:switch:0000A003:lxzn-cbcsmj:1:0000D00D:
|
||||
prop.3.1:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 99999999
|
||||
- 0.01
|
||||
expr: round(src_value/100, 2)
|
||||
prop.3.2:
|
||||
expr: round(src_value/1000, 2)
|
||||
unit: mA
|
||||
prop.3.3:
|
||||
format: float
|
||||
value-range:
|
||||
- 0
|
||||
- 65535
|
||||
- 0.1
|
||||
expr: round(src_value/10, 1)
|
||||
urn:miot-spec-v2:device:thermostat:0000A031:suittc-wk168:1:
|
||||
prop.2.3:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user