preheat_open.unit.Component

class preheat_open.unit.Component(cid=None, id=None, name='', type=None, min=None, max=None, unit='', measurements=None, std_unit='', std_unit_divisor=1.0, parent=None)

Bases: object

Defines a component in the PreHEAT sense.

Variables:
  • cid (int) – The component ID.

  • id (int) – The ID of the component.

  • name (str) – The name of the component.

  • type (Enum) – The type of the component.

  • min (float) – The minimum value of the component.

  • max (float) – The maximum value of the component.

  • unit (str) – The unit of the component.

  • measurements (dict[TimeResolution, ComponentData]) – The measurements of the component.

  • std_unit (str) – The standard unit of the component.

  • std_unit_divisor (float) – The standard unit divisor of the component.

  • parent (Unit | Device) – The parent unit or device of the component.

__init__(cid=None, id=None, name='', type=None, min=None, max=None, unit='', measurements=None, std_unit='', std_unit_divisor=1.0, parent=None)

Methods

__init__([cid, id, name, type, min, max, ...])

check_measurement(date_range)

Checks if measurements are available for the specified date range.

from_building_model_dict(data, adapter)

Creates a Component object from a building model dictionary.

get_measurement(date_range)

Retrieves measurements for the specified date range.

to_building_model_dict()

Converts the Component object to a dictionary.

check_measurement(date_range)

Checks if measurements are available for the specified date range.

Parameters:

date_range (DateRange) – The date range to check.

Returns:

The missing date range.

Return type:

DateRange

classmethod from_building_model_dict(data, adapter)

Creates a Component object from a building model dictionary.

Return type:

Component

get_measurement(date_range)

Retrieves measurements for the specified date range.

Parameters:

date_range (DateRange) – The date range for which to retrieve measurements.

Returns:

The component data for the specified date range.

Return type:

ComponentData

to_building_model_dict()

Converts the Component object to a dictionary.

Returns:

A dictionary representation of the component.

Return type:

dict