Reolink change ir to switch (#105916)

* Change IR from light to switch

* Remove old entity

* Add test

* Apply suggestions from code review

Co-authored-by: Jan-Philipp Benecke <github@bnck.me>

---------

Co-authored-by: Jan-Philipp Benecke <github@bnck.me>
This commit is contained in:
starkillerOG 2023-12-18 11:13:20 +01:00 committed by GitHub
parent 3e50ca6cda
commit 253182c650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 58 additions and 15 deletions

View file

@ -48,6 +48,16 @@ class ReolinkNVRSwitchEntityDescription(
SWITCH_ENTITIES = (
ReolinkSwitchEntityDescription(
key="ir_lights",
cmd_key="GetIrLights",
translation_key="ir_lights",
icon="mdi:led-off",
entity_category=EntityCategory.CONFIG,
supported=lambda api, ch: api.supported(ch, "ir_lights"),
value=lambda api, ch: api.ir_enabled(ch),
method=lambda api, ch, value: api.set_ir_lights(ch, value),
),
ReolinkSwitchEntityDescription(
key="record_audio",
cmd_key="GetEnc",