mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 09:17:10 +00:00
Update docstring for function
This commit is contained in:
parent
942ba37a79
commit
cbb072ad43
@ -166,10 +166,11 @@ def sensor_update_to_bluetooth_data_update(
|
|||||||
val = getattr(adv.readings, key)
|
val = getattr(adv.readings, key)
|
||||||
if val == -1:
|
if val == -1:
|
||||||
continue
|
continue
|
||||||
if key == "status":
|
val = (
|
||||||
val = get_friendly_status(val.name, adv.readings.type.name)
|
get_friendly_status(val.name, adv.readings.type.name)
|
||||||
else:
|
if key == "status"
|
||||||
val *= desc.scale
|
else val * desc.scale
|
||||||
|
)
|
||||||
data[tag] = val
|
data[tag] = val
|
||||||
names[tag] = desc.name
|
names[tag] = desc.name
|
||||||
descs[tag] = desc
|
descs[tag] = desc
|
||||||
@ -224,22 +225,7 @@ class Aranet4BluetoothSensorEntity(
|
|||||||
|
|
||||||
|
|
||||||
def get_friendly_status(status: str, device_type: str) -> str:
|
def get_friendly_status(status: str, device_type: str) -> str:
|
||||||
"""Convert device status to a human-readable string based on device type.
|
"""Convert device status color code to a more human-friendly status 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'
|
|
||||||
|
|
||||||
"""
|
|
||||||
base_status_map = {
|
base_status_map = {
|
||||||
"ERROR": "Error",
|
"ERROR": "Error",
|
||||||
"RED": "Unhealthy",
|
"RED": "Unhealthy",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user