octo_api.consumption

Class to represent consumption data.

Classes:

Consumption(consumption, interval_start, …)

Represents the consumption for a given period of time.

class Consumption(consumption, interval_start, interval_end)[source]

Bases: object

Represents the consumption for a given period of time.

Parameters

Attributes:

consumption

The consumption.

interval_end

The end of the time period.

interval_start

The start of the time period.

Methods:

from_dict(d)

Construct an instance of Consumption from a dictionary.

to_dict([convert_values])

Returns a dictionary containing the contents of the Consumption object.

consumption

Type:    float

The consumption.

classmethod from_dict(d)

Construct an instance of Consumption from a dictionary.

Parameters

d (Mapping[str, Any]) – The dictionary.

interval_end

Type:    datetime

The end of the time period.

interval_start

Type:    datetime

The start of the time period.

to_dict(convert_values=False)

Returns a dictionary containing the contents of the Consumption object.

Parameters

convert_values (bool) – Recursively convert values into dictionaries, lists etc. as appropriate. Default False.

Return type

MutableMapping[str, Any]