parent
da6eca7b68
commit
372886bf6c
3 changed files with 56 additions and 0 deletions
|
@ -7,6 +7,7 @@ from dataclasses import dataclass
|
|||
from reolink_aio.api import (
|
||||
DUAL_LENS_DUAL_MOTION_MODELS,
|
||||
FACE_DETECTION_TYPE,
|
||||
PACKAGE_DETECTION_TYPE,
|
||||
PERSON_DETECTION_TYPE,
|
||||
PET_DETECTION_TYPE,
|
||||
VEHICLE_DETECTION_TYPE,
|
||||
|
@ -86,6 +87,14 @@ BINARY_SENSORS = (
|
|||
value=lambda api, ch: api.ai_detected(ch, PET_DETECTION_TYPE),
|
||||
supported=lambda api, ch: api.supported(ch, "ai_animal"),
|
||||
),
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key=PACKAGE_DETECTION_TYPE,
|
||||
translation_key="package",
|
||||
icon="mdi:gift-outline",
|
||||
icon_off="mdi:gift-off-outline",
|
||||
value=lambda api, ch: api.ai_detected(ch, PACKAGE_DETECTION_TYPE),
|
||||
supported=lambda api, ch: api.ai_supported(ch, PACKAGE_DETECTION_TYPE),
|
||||
),
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key="visitor",
|
||||
translation_key="visitor",
|
||||
|
|
|
@ -166,6 +166,21 @@ NUMBER_ENTITIES = (
|
|||
value=lambda api, ch: api.ai_sensitivity(ch, "vehicle"),
|
||||
method=lambda api, ch, value: api.set_ai_sensitivity(ch, int(value), "vehicle"),
|
||||
),
|
||||
ReolinkNumberEntityDescription(
|
||||
key="ai_package_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_package_sensititvity",
|
||||
icon="mdi:gift-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
native_max_value=100,
|
||||
supported=lambda api, ch: (
|
||||
api.supported(ch, "ai_sensitivity") and api.ai_supported(ch, "package")
|
||||
),
|
||||
value=lambda api, ch: api.ai_sensitivity(ch, "package"),
|
||||
method=lambda api, ch, value: api.set_ai_sensitivity(ch, int(value), "package"),
|
||||
),
|
||||
ReolinkNumberEntityDescription(
|
||||
key="ai_pet_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
|
@ -249,6 +264,23 @@ NUMBER_ENTITIES = (
|
|||
value=lambda api, ch: api.ai_delay(ch, "vehicle"),
|
||||
method=lambda api, ch, value: api.set_ai_delay(ch, int(value), "vehicle"),
|
||||
),
|
||||
ReolinkNumberEntityDescription(
|
||||
key="ai_package_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_package_delay",
|
||||
icon="mdi:gift-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
native_min_value=0,
|
||||
native_max_value=8,
|
||||
supported=lambda api, ch: (
|
||||
api.supported(ch, "ai_delay") and api.ai_supported(ch, "package")
|
||||
),
|
||||
value=lambda api, ch: api.ai_delay(ch, "package"),
|
||||
method=lambda api, ch, value: api.set_ai_delay(ch, int(value), "package"),
|
||||
),
|
||||
ReolinkNumberEntityDescription(
|
||||
key="ai_pet_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
|
|
|
@ -103,6 +103,9 @@
|
|||
"visitor": {
|
||||
"name": "Visitor"
|
||||
},
|
||||
"package": {
|
||||
"name": "Package"
|
||||
},
|
||||
"motion_lens_0": {
|
||||
"name": "Motion lens 0"
|
||||
},
|
||||
|
@ -124,6 +127,9 @@
|
|||
"visitor_lens_0": {
|
||||
"name": "Visitor lens 0"
|
||||
},
|
||||
"package_lens_0": {
|
||||
"name": "Package lens 0"
|
||||
},
|
||||
"motion_lens_1": {
|
||||
"name": "Motion lens 1"
|
||||
},
|
||||
|
@ -144,6 +150,9 @@
|
|||
},
|
||||
"visitor_lens_1": {
|
||||
"name": "Visitor lens 1"
|
||||
},
|
||||
"package_lens_1": {
|
||||
"name": "Package lens 1"
|
||||
}
|
||||
},
|
||||
"button": {
|
||||
|
@ -270,6 +279,9 @@
|
|||
"ai_vehicle_sensititvity": {
|
||||
"name": "AI vehicle sensitivity"
|
||||
},
|
||||
"ai_package_sensititvity": {
|
||||
"name": "AI package sensitivity"
|
||||
},
|
||||
"ai_pet_sensititvity": {
|
||||
"name": "AI pet sensitivity"
|
||||
},
|
||||
|
@ -285,6 +297,9 @@
|
|||
"ai_vehicle_delay": {
|
||||
"name": "AI vehicle delay"
|
||||
},
|
||||
"ai_package_delay": {
|
||||
"name": "AI package delay"
|
||||
},
|
||||
"ai_pet_delay": {
|
||||
"name": "AI pet delay"
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue