mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-15 14:01:14 +08:00
fix: use binary sensor class for door and windows sensor and water leak sensor
fix: use Binary sensor class for door&windows and water leak sensor The original version uses a sensor class for various sensors, such as door and windows sensors, water leak sensors, occupancy sensors, motion sensors, etc., which prevents the HomeKit Bridge from generating corresponding entities. This fix is to use binary sensor class for door andwindows sensor and water leak sensor. Correspoding issue: https://github.com/XiaoMi/ha_xiaomi_home/issues/206
This commit is contained in:
parent
bba8ba7f7b
commit
162f943924
@ -47,6 +47,7 @@ Conversion rules of MIoT-Spec-V2 instance to Home Assistant entity.
|
||||
"""
|
||||
from homeassistant.components.sensor import SensorDeviceClass
|
||||
from homeassistant.components.event import EventDeviceClass
|
||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||
|
||||
# pylint: disable=pointless-string-statement
|
||||
"""SPEC_DEVICE_TRANS_MAP
|
||||
@ -391,6 +392,14 @@ SPEC_PROP_TRANS_MAP: dict[str, dict | str] = {
|
||||
'device_class': SensorDeviceClass.DURATION,
|
||||
'entity': 'sensor'
|
||||
},
|
||||
'submersion-state': {
|
||||
'device_class': BinarySensorDeviceClass.MOISTURE,
|
||||
'entity': 'binary_sensor'
|
||||
},
|
||||
'contact-state': {
|
||||
'device_class': BinarySensorDeviceClass.DOOR,
|
||||
'entity': 'binary_sensor'
|
||||
},
|
||||
'has-someone-duration': 'no-one-determine-time',
|
||||
'no-one-duration': 'no-one-determine-time'
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user