From 1e70a0060b2aefc78ff2534f7950f12cd52689fd Mon Sep 17 00:00:00 2001
From: starkillerOG <starkiller.og@gmail.com>
Date: Tue, 31 Dec 2024 22:27:01 +0100
Subject: [PATCH] Add Reolink baby crying binary sensor (#134290)

* Add baby crying detection

* Bump reolink-aio to 0.11.6
---
 homeassistant/components/reolink/binary_sensor.py | 7 +++++++
 homeassistant/components/reolink/icons.json       | 6 ++++++
 homeassistant/components/reolink/strings.json     | 7 +++++++
 3 files changed, 20 insertions(+)

diff --git a/homeassistant/components/reolink/binary_sensor.py b/homeassistant/components/reolink/binary_sensor.py
index c168c97e809..2191dedc9cf 100644
--- a/homeassistant/components/reolink/binary_sensor.py
+++ b/homeassistant/components/reolink/binary_sensor.py
@@ -100,6 +100,13 @@ BINARY_PUSH_SENSORS = (
         value=lambda api, ch: api.visitor_detected(ch),
         supported=lambda api, ch: api.is_doorbell(ch),
     ),
+    ReolinkBinarySensorEntityDescription(
+        key="cry",
+        cmd_id=33,
+        translation_key="cry",
+        value=lambda api, ch: api.ai_detected(ch, "cry"),
+        supported=lambda api, ch: api.ai_supported(ch, "cry"),
+    ),
 )
 
 BINARY_SENSORS = (
diff --git a/homeassistant/components/reolink/icons.json b/homeassistant/components/reolink/icons.json
index cee044189ea..98d230dc383 100644
--- a/homeassistant/components/reolink/icons.json
+++ b/homeassistant/components/reolink/icons.json
@@ -43,6 +43,12 @@
           "on": "mdi:motion-sensor"
         }
       },
+      "cry": {
+        "default": "mdi:emoticon-happy-outline",
+        "state": {
+          "on": "mdi:emoticon-cry-outline"
+        }
+      },
       "sleep": {
         "default": "mdi:sleep-off",
         "state": {
diff --git a/homeassistant/components/reolink/strings.json b/homeassistant/components/reolink/strings.json
index 50163fa1aca..fbbf50ba20e 100644
--- a/homeassistant/components/reolink/strings.json
+++ b/homeassistant/components/reolink/strings.json
@@ -215,6 +215,13 @@
           "on": "[%key:component::binary_sensor::entity_component::gas::state::on%]"
         }
       },
+      "cry": {
+        "name": "Baby crying",
+        "state": {
+          "off": "[%key:component::binary_sensor::entity_component::gas::state::off%]",
+          "on": "[%key:component::binary_sensor::entity_component::gas::state::on%]"
+        }
+      },
       "motion_lens_0": {
         "name": "Motion lens 0",
         "state": {
-- 
GitLab