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

水浸传感器显示错误,导致homekit 无法识别 #145

Closed
weiyideai520 opened this issue Jul 25, 2021 · 2 comments
Closed

水浸传感器显示错误,导致homekit 无法识别 #145

weiyideai520 opened this issue Jul 25, 2021 · 2 comments
Labels
bug Something isn't working fixed bug fixed homekit

Comments

@weiyideai520
Copy link

weiyideai520 commented Jul 25, 2021

需要在 binary_sensor.py 做如下修改
也是因为 class 写错了,需要用 DEVICE_CLASS_MOISTURE

from homeassistant.components.binary_sensor import (
DOMAIN as ENTITY_DOMAIN,
BinarySensorEntity,
DEVICE_CLASS_MOTION,
DEVICE_CLASS_DOOR,
DEVICE_CLASS_SAFETY,
DEVICE_CLASS_MOISTURE,
)

if miot_service.name in ['submersion_sensor']:
self._prop_state = miot_service.get_property('submersion_state') or self._prop_state
self._vars['device_class'] = DEVICE_CLASS_MOISTURE

另外 一下设备无法识别

绿米的水浸传感器 lumi.sensor_wleak.aq1 SJCGQ11LM
光照传感器 lumi.sen_ill.mgl01 GZCGQ01LM

@al-one al-one added the bug Something isn't working label Jul 25, 2021
@al-one
Copy link
Owner

al-one commented Jul 25, 2021

请再次尝试。

@weiyideai520
Copy link
Author

可以了,幸苦了

@al-one al-one added the fixed bug fixed label Jul 25, 2021
@al-one al-one added the homekit label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed bug fixed homekit
Projects
None yet
Development

No branches or pull requests

2 participants