Add reolink channel based record, push, email, ftp, and buzzer switches (#91006)

* Add channel based email, ftp, push, rec and buzzer switches

* fix dataclass
This commit is contained in:
starkillerOG 2023-06-28 09:18:14 +02:00 committed by GitHub
parent 04e277ac95
commit d2cd0c9934
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,6 +98,50 @@ 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="email",
name="Email on event",
icon="mdi:email",
entity_category=EntityCategory.CONFIG,
supported=lambda api, ch: api.supported(ch, "email") and api.is_nvr,
value=lambda api, ch: api.email_enabled(ch),
method=lambda api, ch, value: api.set_email(ch, value),
),
ReolinkSwitchEntityDescription(
key="ftp_upload",
name="FTP upload",
icon="mdi:swap-horizontal",
entity_category=EntityCategory.CONFIG,
supported=lambda api, ch: api.supported(ch, "ftp") and api.is_nvr,
value=lambda api, ch: api.ftp_enabled(ch),
method=lambda api, ch, value: api.set_ftp(ch, value),
),
ReolinkSwitchEntityDescription(
key="push_notifications",
name="Push notifications",
icon="mdi:message-badge",
entity_category=EntityCategory.CONFIG,
supported=lambda api, ch: api.supported(ch, "push") and api.is_nvr,
value=lambda api, ch: api.push_enabled(ch),
method=lambda api, ch, value: api.set_push(ch, value),
),
ReolinkSwitchEntityDescription(
key="record",
name="Record",
icon="mdi:record-rec",
supported=lambda api, ch: api.supported(ch, "recording") and api.is_nvr,
value=lambda api, ch: api.recording_enabled(ch),
method=lambda api, ch, value: api.set_recording(ch, value),
),
ReolinkSwitchEntityDescription(
key="buzzer",
name="Buzzer on event",
icon="mdi:room-service",
entity_category=EntityCategory.CONFIG,
supported=lambda api, ch: api.supported(ch, "buzzer") and api.is_nvr,
value=lambda api, ch: api.buzzer_enabled(ch),
method=lambda api, ch, value: api.set_buzzer(ch, value),
),
ReolinkSwitchEntityDescription(
key="doorbell_button_sound",
name="Doorbell button sound",