From 55f8a36572367652bc097c52a0260228226b8cae Mon Sep 17 00:00:00 2001 From: Matrix Date: Thu, 13 Jun 2024 15:31:29 +0800 Subject: [PATCH] Improve code readability (#119558) --- homeassistant/components/yolink/switch.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/yolink/switch.py b/homeassistant/components/yolink/switch.py index 2e31100bf3c..c999f04d90d 100644 --- a/homeassistant/components/yolink/switch.py +++ b/homeassistant/components/yolink/switch.py @@ -70,18 +70,22 @@ DEVICE_TYPES: tuple[YoLinkSwitchEntityDescription, ...] = ( translation_key="plug_1", device_class=SwitchDeviceClass.OUTLET, exists_fn=lambda device: device.device_type == ATTR_DEVICE_MULTI_OUTLET, - plug_index_fn=lambda device: 1 - if device.device_model_name.startswith(DEV_MODEL_MULTI_OUTLET_YS6801) - else 0, + plug_index_fn=lambda device: ( + 1 + if device.device_model_name.startswith(DEV_MODEL_MULTI_OUTLET_YS6801) + else 0 + ), ), YoLinkSwitchEntityDescription( key="multi_outlet_plug_2", translation_key="plug_2", device_class=SwitchDeviceClass.OUTLET, exists_fn=lambda device: device.device_type == ATTR_DEVICE_MULTI_OUTLET, - plug_index_fn=lambda device: 2 - if device.device_model_name.startswith(DEV_MODEL_MULTI_OUTLET_YS6801) - else 1, + plug_index_fn=lambda device: ( + 2 + if device.device_model_name.startswith(DEV_MODEL_MULTI_OUTLET_YS6801) + else 1 + ), ), YoLinkSwitchEntityDescription( key="multi_outlet_plug_3",