Add yolink finger support (#96944)
This commit is contained in:
parent
945fffebcc
commit
3bbbd8642f
8 changed files with 61 additions and 14 deletions
|
@ -8,6 +8,7 @@ from yolink.const import (
|
|||
ATTR_DEVICE_CO_SMOKE_SENSOR,
|
||||
ATTR_DEVICE_DIMMER,
|
||||
ATTR_DEVICE_DOOR_SENSOR,
|
||||
ATTR_DEVICE_FINGER,
|
||||
ATTR_DEVICE_LEAK_SENSOR,
|
||||
ATTR_DEVICE_LOCK,
|
||||
ATTR_DEVICE_MANIPULATOR,
|
||||
|
@ -67,6 +68,7 @@ class YoLinkSensorEntityDescription(
|
|||
SENSOR_DEVICE_TYPE = [
|
||||
ATTR_DEVICE_DIMMER,
|
||||
ATTR_DEVICE_DOOR_SENSOR,
|
||||
ATTR_DEVICE_FINGER,
|
||||
ATTR_DEVICE_LEAK_SENSOR,
|
||||
ATTR_DEVICE_MOTION_SENSOR,
|
||||
ATTR_DEVICE_MULTI_OUTLET,
|
||||
|
@ -86,6 +88,7 @@ SENSOR_DEVICE_TYPE = [
|
|||
|
||||
BATTERY_POWER_SENSOR = [
|
||||
ATTR_DEVICE_DOOR_SENSOR,
|
||||
ATTR_DEVICE_FINGER,
|
||||
ATTR_DEVICE_LEAK_SENSOR,
|
||||
ATTR_DEVICE_MOTION_SENSOR,
|
||||
ATTR_DEVICE_POWER_FAILURE_ALARM,
|
||||
|
@ -129,6 +132,7 @@ SENSOR_TYPES: tuple[YoLinkSensorEntityDescription, ...] = (
|
|||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value=cvt_battery,
|
||||
exists_fn=lambda device: device.device_type in BATTERY_POWER_SENSOR,
|
||||
should_update_entity=lambda value: value is not None,
|
||||
),
|
||||
YoLinkSensorEntityDescription(
|
||||
key="humidity",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue