Reolink use parenthesis for multi-line lambda (#104321)
Use parenthesis
This commit is contained in:
parent
59469828f1
commit
6c6e85f996
2 changed files with 7 additions and 4 deletions
|
@ -71,8 +71,10 @@ BINARY_SENSORS = (
|
||||||
icon="mdi:dog-side",
|
icon="mdi:dog-side",
|
||||||
icon_off="mdi:dog-side-off",
|
icon_off="mdi:dog-side-off",
|
||||||
value=lambda api, ch: api.ai_detected(ch, PET_DETECTION_TYPE),
|
value=lambda api, ch: api.ai_detected(ch, PET_DETECTION_TYPE),
|
||||||
supported=lambda api, ch: api.ai_supported(ch, PET_DETECTION_TYPE)
|
supported=lambda api, ch: (
|
||||||
and not api.supported(ch, "ai_animal"),
|
api.ai_supported(ch, PET_DETECTION_TYPE)
|
||||||
|
and not api.supported(ch, "ai_animal")
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ReolinkBinarySensorEntityDescription(
|
ReolinkBinarySensorEntityDescription(
|
||||||
key=PET_DETECTION_TYPE,
|
key=PET_DETECTION_TYPE,
|
||||||
|
|
|
@ -49,8 +49,9 @@ BUTTON_ENTITIES = (
|
||||||
translation_key="ptz_stop",
|
translation_key="ptz_stop",
|
||||||
icon="mdi:pan",
|
icon="mdi:pan",
|
||||||
enabled_default=lambda api, ch: api.supported(ch, "pan_tilt"),
|
enabled_default=lambda api, ch: api.supported(ch, "pan_tilt"),
|
||||||
supported=lambda api, ch: api.supported(ch, "pan_tilt")
|
supported=lambda api, ch: (
|
||||||
or api.supported(ch, "zoom_basic"),
|
api.supported(ch, "pan_tilt") or api.supported(ch, "zoom_basic")
|
||||||
|
),
|
||||||
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.stop.value),
|
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.stop.value),
|
||||||
),
|
),
|
||||||
ReolinkButtonEntityDescription(
|
ReolinkButtonEntityDescription(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue