preheat_open.collection.Collection
- class preheat_open.collection.Collection(locations=<factory>, adapter=None, _models_loaded=False)
Bases:
objectRepresents a collection of locations.
- Variables:
locations – The locations in the collection.
- __init__(locations=<factory>, adapter=None, _models_loaded=False)
Methods
__init__([locations, adapter, _models_loaded])filter(location_info_filter)Filters the collection based on a filter function.
from_location_ids(location_ids, adapter, ...)Creates a collection from a list of locations.
Creates a collection from a list of location information.
get_components([query])Retrieves components associated with the location.
get_devices([query])Retrieves devices associated with the location.
get_keys(**kwargs)- rtype:
Generator[None,None,LocationInformation]
get_measurements(**kwargs)Retrieves measurements for the location.
get_units([query])Retrieves units associated with the location.
get_zones([query])Retrieves zones associated with the location.
Loads the building models for each location in the collection.
Attributes
adapterThe timezone of the location.
locations- filter(location_info_filter)
Filters the collection based on a filter function.
- Parameters:
filter_func – The filter function.
- Return type:
- Returns:
The filtered collection.
- classmethod from_location_ids(location_ids, adapter, **kwargs)
Creates a collection from a list of locations.
- Parameters:
location_list – The list of locations.
- Return type:
- Returns:
The collection.
- classmethod from_location_information_list(location_information_list, **kwargs)
Creates a collection from a list of location information.
- Parameters:
location_information_list (
list[LocationInformation]) – The list of location information.- Return type:
- Returns:
The collection.
- get_components(query=None, **kwargs)
Retrieves components associated with the location.
- get_devices(query=None, **kwargs)
Retrieves devices associated with the location.
- get_measurements(**kwargs)
Retrieves measurements for the location.
- Parameters:
- Returns:
A DataFrame containing the measurements.
- Return type:
pd.DataFrame
- get_units(query=None, **kwargs)
Retrieves units associated with the location.
- get_zones(query=None, **kwargs)
Retrieves zones associated with the location.
- load_building_models()
Loads the building models for each location in the collection.
- Return type:
None
- property timezone: tzinfo
The timezone of the location.
- Returns:
The timezone.
- Return type:
str