You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
需要在 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
需要在 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
The text was updated successfully, but these errors were encountered: