From 977d4c8f01d04910d518b75c7881a44db0759bd7 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Tue, 26 Aug 2025 19:30:14 +0200 Subject: [PATCH] Add Reolink speak and doorbell volume entities (#151198) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Norbert Rittel --- homeassistant/components/reolink/icons.json | 12 ++++++++++ homeassistant/components/reolink/number.py | 24 +++++++++++++++++++ homeassistant/components/reolink/strings.json | 6 +++++ .../reolink/snapshots/test_diagnostics.ambr | 4 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/reolink/icons.json b/homeassistant/components/reolink/icons.json index 597a3372400..7dc9721d172 100644 --- a/homeassistant/components/reolink/icons.json +++ b/homeassistant/components/reolink/icons.json @@ -181,6 +181,18 @@ "0": "mdi:volume-off" } }, + "volume_speak": { + "default": "mdi:volume-high", + "state": { + "0": "mdi:volume-off" + } + }, + "volume_doorbell": { + "default": "mdi:volume-high", + "state": { + "0": "mdi:volume-off" + } + }, "alarm_volume": { "default": "mdi:volume-high", "state": { diff --git a/homeassistant/components/reolink/number.py b/homeassistant/components/reolink/number.py index 8f39fcd4880..222462166bf 100644 --- a/homeassistant/components/reolink/number.py +++ b/homeassistant/components/reolink/number.py @@ -150,6 +150,30 @@ NUMBER_ENTITIES = ( value=lambda api, ch: api.volume(ch), method=lambda api, ch, value: api.set_volume(ch, volume=int(value)), ), + ReolinkNumberEntityDescription( + key="volume_speak", + cmd_key="GetAudioCfg", + translation_key="volume_speak", + entity_category=EntityCategory.CONFIG, + native_step=1, + native_min_value=0, + native_max_value=100, + supported=lambda api, ch: api.supported(ch, "volume_speek"), + value=lambda api, ch: api.volume_speek(ch), + method=lambda api, ch, value: api.set_volume(ch, volume_speek=int(value)), + ), + ReolinkNumberEntityDescription( + key="volume_doorbell", + cmd_key="GetAudioCfg", + translation_key="volume_doorbell", + entity_category=EntityCategory.CONFIG, + native_step=1, + native_min_value=0, + native_max_value=100, + supported=lambda api, ch: api.supported(ch, "volume_doorbell"), + value=lambda api, ch: api.volume_doorbell(ch), + method=lambda api, ch, value: api.set_volume(ch, volume_doorbell=int(value)), + ), ReolinkNumberEntityDescription( key="guard_return_time", cmd_key="GetPtzGuard", diff --git a/homeassistant/components/reolink/strings.json b/homeassistant/components/reolink/strings.json index 7e8bf94eeae..af7d9369fff 100644 --- a/homeassistant/components/reolink/strings.json +++ b/homeassistant/components/reolink/strings.json @@ -541,6 +541,12 @@ "volume": { "name": "Volume" }, + "volume_speak": { + "name": "Speak volume" + }, + "volume_doorbell": { + "name": "Doorbell volume" + }, "alarm_volume": { "name": "Alarm volume" }, diff --git a/tests/components/reolink/snapshots/test_diagnostics.ambr b/tests/components/reolink/snapshots/test_diagnostics.ambr index ca35d7eb70f..f6037c5b701 100644 --- a/tests/components/reolink/snapshots/test_diagnostics.ambr +++ b/tests/components/reolink/snapshots/test_diagnostics.ambr @@ -98,8 +98,8 @@ 'null': 1, }), 'GetAudioCfg': dict({ - '0': 2, - 'null': 2, + '0': 4, + 'null': 4, }), 'GetAutoFocus': dict({ '0': 1,