Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.ista_ecotrend.util Namespace Reference

Classes

class  IstaConsumptionType
 
class  IstaValueType
 

Functions

float|int|None as_number (str|float|None value)
 
list[dict[str, Any]] get_consumptions (dict[str, Any] data, IstaValueType|None value_type=None)
 
int|float|None get_native_value (data, IstaConsumptionType consumption_type, IstaValueType|None value_type=None)
 
list[dict[str, Any]]|None get_statistics (data, IstaConsumptionType consumption_type, IstaValueType|None value_type=None)
 
dict[str, Any] get_values_by_type (dict[str, Any] consumptions, IstaConsumptionType consumption_type)
 
datetime.datetime last_day_of_month (int month, int year)
 

Detailed Description

Utility functions for Ista EcoTrend integration.

Function Documentation

◆ as_number()

float | int | None homeassistant.components.ista_ecotrend.util.as_number ( str | float | None  value)
Convert readings to float or int.

Readings in the json response are returned as strings,
float values have comma as decimal separator

Definition at line 63 of file util.py.

◆ get_consumptions()

list[dict[str, Any]] homeassistant.components.ista_ecotrend.util.get_consumptions ( dict[str, Any]  data,
IstaValueType | None   value_type = None 
)
Get consumption readings and sort in ascending order by date.

Definition at line 27 of file util.py.

◆ get_native_value()

int | float | None homeassistant.components.ista_ecotrend.util.get_native_value (   data,
IstaConsumptionType  consumption_type,
IstaValueType | None   value_type = None 
)
Determine the latest value for the sensor.

Definition at line 89 of file util.py.

◆ get_statistics()

list[dict[str, Any]] | None homeassistant.components.ista_ecotrend.util.get_statistics (   data,
IstaConsumptionType  consumption_type,
IstaValueType | None   value_type = None 
)
Determine the latest value for the sensor.

Definition at line 101 of file util.py.

◆ get_values_by_type()

dict[str, Any] homeassistant.components.ista_ecotrend.util.get_values_by_type ( dict[str, Any]  consumptions,
IstaConsumptionType   consumption_type 
)
Get the readings of a certain type.

Definition at line 48 of file util.py.

◆ last_day_of_month()

datetime.datetime homeassistant.components.ista_ecotrend.util.last_day_of_month ( int  month,
int  year 
)
Get the last day of the month.

Definition at line 75 of file util.py.