From 7aedd1f602debfc2e0b9200000856cdbfe3866ee Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 16 Oct 2023 22:29:09 -0400 Subject: [PATCH 1/2] Add some entity categories --- homeassistant/components/reolink/select.py | 2 ++ homeassistant/components/reolink/siren.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/homeassistant/components/reolink/select.py b/homeassistant/components/reolink/select.py index 84d39b3d8e2d11..2139ca87e3c708 100644 --- a/homeassistant/components/reolink/select.py +++ b/homeassistant/components/reolink/select.py @@ -70,6 +70,7 @@ class ReolinkSelectEntityDescription( key="ptz_preset", translation_key="ptz_preset", icon="mdi:pan", + entity_category=EntityCategory.CONFIG, get_options=lambda api, ch: list(api.ptz_presets(ch)), supported=lambda api, ch: api.supported(ch, "ptz_presets"), method=lambda api, ch, name: api.set_ptz_command(ch, preset=name), @@ -78,6 +79,7 @@ class ReolinkSelectEntityDescription( key="auto_quick_reply_message", translation_key="auto_quick_reply_message", icon="mdi:message-reply-text-outline", + entity_category=EntityCategory.CONFIG, get_options=lambda api, ch: list(api.quick_reply_dict(ch).values()), supported=lambda api, ch: api.supported(ch, "quick_reply"), value=lambda api, ch: api.quick_reply_dict(ch)[api.quick_reply_file(ch)], diff --git a/homeassistant/components/reolink/siren.py b/homeassistant/components/reolink/siren.py index c91f633ecab7c0..f15c5b65201588 100644 --- a/homeassistant/components/reolink/siren.py +++ b/homeassistant/components/reolink/siren.py @@ -15,6 +15,7 @@ SirenEntityFeature, ) from homeassistant.config_entries import ConfigEntry +from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -35,6 +36,7 @@ class ReolinkSirenEntityDescription(SirenEntityDescription): key="siren", translation_key="siren", icon="mdi:alarm-light", + entity_category=EntityCategory.CONFIG, supported=lambda api, ch: api.supported(ch, "siren_play"), ), ) From 02a159eac474f6a5a963e470d5105614ad785f1d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 17 Oct 2023 13:15:08 -0400 Subject: [PATCH 2/2] Address comments --- homeassistant/components/reolink/select.py | 1 - homeassistant/components/reolink/siren.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/homeassistant/components/reolink/select.py b/homeassistant/components/reolink/select.py index 2139ca87e3c708..fd42e69268d249 100644 --- a/homeassistant/components/reolink/select.py +++ b/homeassistant/components/reolink/select.py @@ -70,7 +70,6 @@ class ReolinkSelectEntityDescription( key="ptz_preset", translation_key="ptz_preset", icon="mdi:pan", - entity_category=EntityCategory.CONFIG, get_options=lambda api, ch: list(api.ptz_presets(ch)), supported=lambda api, ch: api.supported(ch, "ptz_presets"), method=lambda api, ch, name: api.set_ptz_command(ch, preset=name), diff --git a/homeassistant/components/reolink/siren.py b/homeassistant/components/reolink/siren.py index f15c5b65201588..c91f633ecab7c0 100644 --- a/homeassistant/components/reolink/siren.py +++ b/homeassistant/components/reolink/siren.py @@ -15,7 +15,6 @@ SirenEntityFeature, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -36,7 +35,6 @@ class ReolinkSirenEntityDescription(SirenEntityDescription): key="siren", translation_key="siren", icon="mdi:alarm-light", - entity_category=EntityCategory.CONFIG, supported=lambda api, ch: api.supported(ch, "siren_play"), ), )