custom_components/nea_sg_weather/nea.py
def list_mean(values):
    """Function to calculate mean from list"""
    sum_values = 0
    i = 0
    for value in values:
        if value["value"] > 0:
            sum_values += value["value"]
            i += 1
    return round(sum_values / i, 2)
Function to calculate mean from list
Function to calculate mean from list
Function to calculate mean from list
def list_mean(values):
    sum_values = 0
    i = 0
    for value in values:
        if value["value"] > 0:
            sum_values += value["value"]
            i += 1
    return round(sum_values / i, 2)
def list_mean ( values ) : sum_values = 0 i = 0 for value in values : if value [ "value" ] > 0 : sum_values += value [ "value" ] i += 1 return round ( sum_values / i , 2 )
Function to calculate mean from list
Function to calculate mean from list
"""Function to calculate mean from list"""
values