Replace Reolink HDR switch by HDR select entity (#122373)
* Add HDR select * Update strings.json * Update strings.json * add icon * remove HDR switch * cleanup old HDR switch * add tests * Keep HDR switch entity around untill HA 2025.2.0 * Add repair issue * Update strings.json * fixes and review comments * Add tests * Update homeassistant/components/reolink/strings.json Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Update homeassistant/components/reolink/switch.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * fixes and simplify --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
0d765a27c9
commit
1fd3c9d6dd
5 changed files with 147 additions and 11 deletions
|
@ -9,6 +9,7 @@ from typing import Any
|
|||
|
||||
from reolink_aio.api import (
|
||||
DayNightEnum,
|
||||
HDREnum,
|
||||
Host,
|
||||
SpotlightModeEnum,
|
||||
StatusLedEnum,
|
||||
|
@ -118,6 +119,17 @@ SELECT_ENTITIES = (
|
|||
api.set_status_led(ch, StatusLedEnum[name].value, doorbell=True)
|
||||
),
|
||||
),
|
||||
ReolinkSelectEntityDescription(
|
||||
key="hdr",
|
||||
cmd_key="GetIsp",
|
||||
translation_key="hdr",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
get_options=[method.name for method in HDREnum],
|
||||
supported=lambda api, ch: api.supported(ch, "HDR"),
|
||||
value=lambda api, ch: HDREnum(api.HDR_state(ch)).name,
|
||||
method=lambda api, ch, name: api.set_HDR(ch, HDREnum[name].value),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue