Reolink doorbell extend features (#90469)
parent
9197316b57
commit
8544d73b88
|
@ -67,7 +67,7 @@ LIGHT_ENTITIES = (
|
|||
name="Status LED",
|
||||
icon="mdi:lightning-bolt-circle",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported_fn=lambda api, ch: api.supported(ch, "status_led"),
|
||||
supported_fn=lambda api, ch: api.supported(ch, "power_led"),
|
||||
is_on_fn=lambda api, ch: api.status_led_enabled(ch),
|
||||
turn_on_off_fn=lambda api, ch, value: api.set_status_led(ch, value),
|
||||
),
|
||||
|
|
|
@ -5,7 +5,13 @@ from collections.abc import Callable
|
|||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from reolink_aio.api import DayNightEnum, Host, SpotlightModeEnum, TrackMethodEnum
|
||||
from reolink_aio.api import (
|
||||
DayNightEnum,
|
||||
Host,
|
||||
SpotlightModeEnum,
|
||||
StatusLedEnum,
|
||||
TrackMethodEnum,
|
||||
)
|
||||
|
||||
from homeassistant.components.select import SelectEntity, SelectEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -90,6 +96,17 @@ SELECT_ENTITIES = (
|
|||
value=lambda api, ch: TrackMethodEnum(api.auto_track_method(ch)).name,
|
||||
method=lambda api, ch, name: api.set_auto_tracking(ch, method=name),
|
||||
),
|
||||
ReolinkSelectEntityDescription(
|
||||
key="status_led",
|
||||
name="Status LED",
|
||||
icon="mdi:lightning-bolt-circle",
|
||||
translation_key="status_led",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
get_options=[state.name for state in StatusLedEnum],
|
||||
supported=lambda api, ch: api.supported(ch, "doorbell_led"),
|
||||
value=lambda api, ch: StatusLedEnum(api.doorbell_led(ch)).name,
|
||||
method=lambda api, ch, name: api.set_status_led(ch, StatusLedEnum[name].value),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -83,6 +83,13 @@
|
|||
"digitalfirst": "Digital first",
|
||||
"pantiltfirst": "Pan/tilt first"
|
||||
}
|
||||
},
|
||||
"status_led": {
|
||||
"state": {
|
||||
"stayoff": "Stay off",
|
||||
"auto": "Auto",
|
||||
"alwaysonatnight": "Auto & always on at night"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,6 +98,15 @@ SWITCH_ENTITIES = (
|
|||
value=lambda api, ch: api.ptz_guard_enabled(ch),
|
||||
method=lambda api, ch, value: api.set_ptz_guard(ch, enable=value),
|
||||
),
|
||||
ReolinkSwitchEntityDescription(
|
||||
key="doorbell_button_sound",
|
||||
name="Doorbell button sound",
|
||||
icon="mdi:volume-high",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "doorbell_button_sound"),
|
||||
value=lambda api, ch: api.doorbell_button_sound(ch),
|
||||
method=lambda api, ch, value: api.set_volume(ch, doorbell_button_sound=value),
|
||||
),
|
||||
)
|
||||
|
||||
NVR_SWITCH_ENTITIES = (
|
||||
|
|
Loading…
Reference in New Issue