From cbb072ad43577f78f16d79b68502a4145d50cf2d Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Thu, 6 Feb 2025 08:58:18 +0000 Subject: [PATCH] Update docstring for function --- homeassistant/components/aranet/sensor.py | 26 ++++++----------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/aranet/sensor.py b/homeassistant/components/aranet/sensor.py index 3f93fd631ec..a44aee6521f 100644 --- a/homeassistant/components/aranet/sensor.py +++ b/homeassistant/components/aranet/sensor.py @@ -166,10 +166,11 @@ def sensor_update_to_bluetooth_data_update( val = getattr(adv.readings, key) if val == -1: continue - if key == "status": - val = get_friendly_status(val.name, adv.readings.type.name) - else: - val *= desc.scale + val = ( + get_friendly_status(val.name, adv.readings.type.name) + if key == "status" + else val * desc.scale + ) data[tag] = val names[tag] = desc.name descs[tag] = desc @@ -224,22 +225,7 @@ class Aranet4BluetoothSensorEntity( def get_friendly_status(status: str, device_type: str) -> str: - """Convert device status to a human-readable string based on device type. - - Args: - status: Raw status string from device (e.g., "GREEN", "RED") - device_type: Aranet device type (e.g., "ARANET4", "ARANET_RADON") - - Returns: - Friendly status string (e.g., "Good", "Unhealthy") - - Example: - >>> get_friendly_status("GREEN", "ARANET4") - 'Good' - >>> get_friendly_status("GREEN", "ARANET_RADON") - 'Normal' - - """ + """Convert device status color code to a more human-friendly status based on device type.""" base_status_map = { "ERROR": "Error", "RED": "Unhealthy",