preheat_open.loadable_types.ComfortProfile

class preheat_open.loadable_types.ComfortProfile(id=None, name='', setpoints=<factory>)

Bases: LoadableDataType

Represents a comfort profile containing multiple setpoints.

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

  • name (str) – The name of the comfort profile.

  • setpoints (list[Setpoint]) – A list of setpoints associated with the comfort profile.

__init__(id=None, name='', setpoints=<factory>)

Methods

__init__([id, name, setpoints])

add_data(data)

Adds setpoints to the comfort profile.

astimezone(tz)

Converts the comfort profile to the specified timezone.

get_data(date_range)

Retrieves setpoints for the specified date range.

to_frame()

Converts the comfort profile to a pandas DataFrame.

Attributes

id

name

setpoints

add_data(data)

Adds setpoints to the comfort profile.

Parameters:

data (ComfortProfile) – The setpoints to add.

Return type:

None

astimezone(tz)

Converts the comfort profile to the specified timezone.

Parameters:

tz (tzinfo) – The timezone to convert to.

Returns:

A ComfortProfile object with the setpoints converted to the specified timezone.

Return type:

ComfortProfile

get_data(date_range)

Retrieves setpoints for the specified date range.

Parameters:

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

Returns:

A tuple containing the date range and the setpoints.

Return type:

tuple[DateRange, list[Setpoint]]

to_frame()

Converts the comfort profile to a pandas DataFrame.

Returns:

A DataFrame containing the setpoints.

Return type:

pd.DataFrame