Skip to content

Commit

Permalink
Add Reolink manual record switch (home-assistant#119232)
Browse files Browse the repository at this point in the history
Add manual record switch
  • Loading branch information
starkillerOG authored Jun 9, 2024
1 parent 39820ca commit b70a33a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions homeassistant/components/reolink/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@
"record": {
"default": "mdi:record-rec"
},
"manual_record": {
"default": "mdi:record-rec"
},
"buzzer": {
"default": "mdi:room-service"
},
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/reolink/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,9 @@
"record": {
"name": "Record"
},
"manual_record": {
"name": "Manual record"
},
"buzzer": {
"name": "Buzzer on event"
},
Expand Down
9 changes: 9 additions & 0 deletions homeassistant/components/reolink/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ class ReolinkNVRSwitchEntityDescription(
value=lambda api, ch: api.recording_enabled(ch),
method=lambda api, ch, value: api.set_recording(ch, value),
),
ReolinkSwitchEntityDescription(
key="manual_record",
cmd_key="GetManualRec",
translation_key="manual_record",
entity_category=EntityCategory.CONFIG,
supported=lambda api, ch: api.supported(ch, "manual_record"),
value=lambda api, ch: api.manual_record_enabled(ch),
method=lambda api, ch, value: api.set_manual_record(ch, value),
),
ReolinkSwitchEntityDescription(
key="buzzer",
cmd_key="GetBuzzerAlarmV20",
Expand Down

0 comments on commit b70a33a

Please sign in to comment.