preheat_open.location.Location

class preheat_open.location.Location(id=None, information=None, zones=None, units=None, characteristics=None, supply_points=None, adapter=None, comfort_profiles=None)

Bases: object

Represents a location in the PreHEAT sense.

Variables:
  • id (Optional[int]) – The unique identifier of the location.

  • information (LocationInformation) – The information of the location.

  • zones (list[Zone]) – A list of zones associated with the location.

  • units (list[Unit]) – A list of units associated with the location.

  • characteristics (LocationCharacteristics) – The characteristics of the location.

  • supply_points (list[SupplyPoint]) – A list of supply points associated with the location.

  • _device_query_type (Query) – The query type for devices.

  • __devices (list[Device]) – A list of devices associated with the location.

  • __devices_loaded (bool) – Indicates if the devices have been loaded.

  • adapter (Adapter) – The adapter for the location.

  • comfort_profiles (list[ComfortProfile]) – A list of comfort profiles associated with the location.

__init__(id=None, information=None, zones=None, units=None, characteristics=None, supply_points=None, adapter=None, comfort_profiles=None)

Methods

__init__([id, information, zones, units, ...])

from_building_model_dict(data, adapter)

Creates a Location object from a building model dictionary.

get_comfort_profiles(date_range)

Retrieves comfort profiles for the location within the specified time range.

get_components([query])

Retrieves components associated with the location.

get_devices([query])

Retrieves devices associated with the location.

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.

to_building_model_dict()

Converts the location to a building model dictionary.

Attributes

adapter

Returns the adapter associated with the location.

devices

Returns the list of devices associated with the location.

timezone

Returns the timezone of the location.

property adapter: Adapter

Returns the adapter associated with the location.

Returns:

The adapter for the location.

Return type:

Adapter

property devices: list[preheat_open.unit.Device]

Returns the list of devices associated with the location.

Returns:

A list of devices.

Return type:

list[Device]

classmethod from_building_model_dict(data, adapter)

Creates a Location object from a building model dictionary.

Return type:

Location

get_comfort_profiles(date_range)

Retrieves comfort profiles for the location within the specified time range.

Parameters:

date_range (DateRange) – The date range for the comfort profiles.

Returns:

A list of comfort profiles.

Return type:

list[ComfortProfile]

get_components(query=None, **kwargs)

Retrieves components associated with the location.

Parameters:
  • query (Query | list[Query | dict], optional) – The query to filter components.

  • kwargs – Additional arguments.

Returns:

A generator yielding components.

Return type:

Generator[Component, None, None]

get_devices(query=None, **kwargs)

Retrieves devices associated with the location.

Parameters:
  • query (Query | list[Query | dict], optional) – The query to filter devices.

  • kwargs – Additional arguments.

Returns:

A generator yielding devices.

Return type:

Generator[Device, None, None]

get_measurements(**kwargs)

Retrieves measurements for the location.

Parameters:
  • components (list[Component] | Query | dict) – The components to get measurements for.

  • date_range (DateRange, optional) – The date range for the measurements.

  • mapper (MapApplier, optional) – The mapper to apply to the measurements.

  • kwargs – Additional arguments.

Returns:

A DataFrame containing the measurements.

Return type:

pd.DataFrame

get_units(query=None, **kwargs)

Retrieves units associated with the location.

Parameters:
  • query (Query, optional) – The query to filter units.

  • kwargs – Additional arguments.

Returns:

A generator yielding units.

Return type:

Generator[Unit, None, None]

get_zones(query=None, **kwargs)

Retrieves zones associated with the location.

Parameters:
  • query (Query, optional) – The query to filter zones.

  • kwargs – Additional arguments.

Returns:

A generator yielding zones.

Return type:

Generator[Zone, None, None]

property timezone: tzinfo

Returns the timezone of the location.

Returns:

The timezone of the location.

Return type:

tzinfo

to_building_model_dict()

Converts the location to a building model dictionary.

Returns:

A dictionary containing the location information.

Return type:

dict