Reolink use parenthesis for multi-line lambda (#104321)

Use parenthesis
pull/104349/head
starkillerOG 2023-11-22 08:50:29 +01:00 committed by GitHub
parent 59469828f1
commit 6c6e85f996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -71,8 +71,10 @@ BINARY_SENSORS = (
icon="mdi:dog-side",
icon_off="mdi:dog-side-off",
value=lambda api, ch: api.ai_detected(ch, PET_DETECTION_TYPE),
supported=lambda api, ch: api.ai_supported(ch, PET_DETECTION_TYPE)
and not api.supported(ch, "ai_animal"),
supported=lambda api, ch: (
api.ai_supported(ch, PET_DETECTION_TYPE)
and not api.supported(ch, "ai_animal")
),
),
ReolinkBinarySensorEntityDescription(
key=PET_DETECTION_TYPE,

View File

@ -49,8 +49,9 @@ BUTTON_ENTITIES = (
translation_key="ptz_stop",
icon="mdi:pan",
enabled_default=lambda api, ch: api.supported(ch, "pan_tilt"),
supported=lambda api, ch: api.supported(ch, "pan_tilt")
or api.supported(ch, "zoom_basic"),
supported=lambda api, ch: (
api.supported(ch, "pan_tilt") or api.supported(ch, "zoom_basic")
),
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.stop.value),
),
ReolinkButtonEntityDescription(