Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Reolink binning mode select entity #131570

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions homeassistant/components/reolink/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@
"hdr": {
"default": "mdi:hdr"
},
"binning_mode": {
"default": "mdi:code-block-brackets"
},
"hub_alarm_ringtone": {
"default": "mdi:music-note",
"state": {
Expand Down
14 changes: 14 additions & 0 deletions homeassistant/components/reolink/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import Any

from reolink_aio.api import (
BinningModeEnum,
Chime,
ChimeToneEnum,
DayNightEnum,
Expand Down Expand Up @@ -175,6 +176,19 @@ def _get_quick_reply_id(api: Host, ch: int, mess: str) -> int:
value=lambda api, ch: HDREnum(api.HDR_state(ch)).name,
method=lambda api, ch, name: api.set_HDR(ch, HDREnum[name].value),
),
ReolinkSelectEntityDescription(
key="binning_mode",
cmd_key="GetIsp",
translation_key="binning_mode",
entity_category=EntityCategory.CONFIG,
entity_registry_enabled_default=False,
get_options=[method.name for method in BinningModeEnum],
supported=lambda api, ch: api.supported(ch, "binning_mode"),
value=lambda api, ch: BinningModeEnum(api.binning_mode(ch)).name,
method=lambda api, ch, name: api.set_binning_mode(
ch, BinningModeEnum[name].value
),
),
ReolinkSelectEntityDescription(
key="main_frame_rate",
cmd_key="GetEnc",
Expand Down
14 changes: 11 additions & 3 deletions homeassistant/components/reolink/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
"name": "Floodlight mode",
"state": {
"off": "[%key:common::state::off%]",
"auto": "Auto",
"auto": "[%key:component::reolink::entity::select::day_night_mode::state::auto%]",
"onatnight": "On at night",
"schedule": "Schedule",
"adaptive": "Adaptive",
Expand Down Expand Up @@ -529,7 +529,7 @@
"name": "Doorbell LED",
"state": {
"stayoff": "Stay off",
"auto": "Auto",
"auto": "[%key:component::reolink::entity::select::day_night_mode::state::auto%]",
"alwaysonatnight": "Auto & always on at night",
"alwayson": "Always on"
}
Expand All @@ -539,7 +539,15 @@
"state": {
"off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]",
"auto": "Auto"
"auto": "[%key:component::reolink::entity::select::day_night_mode::state::auto%]"
}
},
"binning_mode": {
"name": "Binning mode",
"state": {
"off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]",
"auto": "[%key:component::reolink::entity::select::day_night_mode::state::auto%]"
}
},
"hub_alarm_ringtone": {
Expand Down
Loading