From 6c6e85f996c58f6eaa993dea39306ac0df1cc867 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Wed, 22 Nov 2023 08:50:29 +0100 Subject: [PATCH] Reolink use parenthesis for multi-line lambda (#104321) Use parenthesis --- homeassistant/components/reolink/binary_sensor.py | 6 ++++-- homeassistant/components/reolink/button.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/reolink/binary_sensor.py b/homeassistant/components/reolink/binary_sensor.py index 5fe14c6223c..e2e8e6b24f9 100644 --- a/homeassistant/components/reolink/binary_sensor.py +++ b/homeassistant/components/reolink/binary_sensor.py @@ -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, diff --git a/homeassistant/components/reolink/button.py b/homeassistant/components/reolink/button.py index c98d518be03..8d9f1e55581 100644 --- a/homeassistant/components/reolink/button.py +++ b/homeassistant/components/reolink/button.py @@ -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(