toonlib package

Submodules

toonlib.configuration module

A place to store the configuration.

toonlib.helpers module

All helper objects will live here

class toonlib.helpers.Agreement(id, checksum, city, display_common_name, display_hardware_version, display_software_version, heating_type, house_number, boiler_management, solar, toonly, post_code, street_name)

Bases: tuple

boiler_management

Alias for field number 8

checksum

Alias for field number 1

city

Alias for field number 2

display_common_name

Alias for field number 3

display_hardware_version

Alias for field number 4

display_software_version

Alias for field number 5

heating_type

Alias for field number 6

house_number

Alias for field number 7

id

Alias for field number 0

post_code

Alias for field number 11

solar

Alias for field number 9

street_name

Alias for field number 12

toonly

Alias for field number 10

class toonlib.helpers.Client(id, checksum, hash, sample, personal_details)

Bases: tuple

checksum

Alias for field number 1

hash

Alias for field number 2

id

Alias for field number 0

personal_details

Alias for field number 4

sample

Alias for field number 3

class toonlib.helpers.Data(toon_instance)[source]

Bases: object

Data object exposing flow and graph attributes.

class Flow(toon_instance)[source]

Bases: object

The object that exposes the flow information of categories in toon

The information is rrd metrics and the object dynamically handles the accessing of attributes matching with the corresponding api endpoint if they are know, raises an exception if not.

class Data.Graph(toon_instance)[source]

Bases: object

The object that exposes the graph information of categories in toon

The information is rrd metrics and the object dynamically handles the accessing of attributes matching with the corresponding api endpoint if they are know, raises an exception if not.

class toonlib.helpers.Light(toon_instance, name)[source]

Bases: toonlib.helpers.Switch

Object modeling the hue light bulbs that toon can interact with.

It inherits from switch which is the common interface with the hue lamps to turn on, off or toggle

rgb_color
class toonlib.helpers.Low(meter_reading_low, daily_usage_low)

Bases: tuple

daily_usage_low

Alias for field number 1

meter_reading_low

Alias for field number 0

class toonlib.helpers.PersonalDetails(number, email, first_name, last_name, middle_name, mobile_number, phone_number)

Bases: tuple

email

Alias for field number 1

first_name

Alias for field number 2

last_name

Alias for field number 3

middle_name

Alias for field number 4

mobile_number

Alias for field number 5

number

Alias for field number 0

phone_number

Alias for field number 6

class toonlib.helpers.PowerUsage(average_daily, average, daily_cost, daily_usage, is_smart, meter_reading, value, meter_reading_low, daily_usage_low, maximum, produced, solar, average_produced, meter_reading_low_produced, meter_reading_produced, daily_cost_produced)

Bases: tuple

average

Alias for field number 1

average_daily

Alias for field number 0

average_produced

Alias for field number 12

daily_cost

Alias for field number 2

daily_cost_produced

Alias for field number 15

daily_usage

Alias for field number 3

daily_usage_low

Alias for field number 8

is_smart

Alias for field number 4

maximum

Alias for field number 9

meter_reading

Alias for field number 5

meter_reading_low

Alias for field number 7

meter_reading_low_produced

Alias for field number 13

meter_reading_produced

Alias for field number 14

produced

Alias for field number 10

solar

Alias for field number 11

value

Alias for field number 6

class toonlib.helpers.SmartPlug(toon_instance, name)[source]

Bases: toonlib.helpers.Switch

Object modeling the fibaro smart plugs the toon can interact with.

It inherits from switch which is the common interface with the hue lamps to turn on, off or toggle

average_usage
current_usage
daily_usage
flow_graph_uuid
network_health_state
quantity_graph_uuid
usage_capable
class toonlib.helpers.Solar(maximum, produced, solar, average_produced, meter_reading_low_produced, meter_reading_produced, daily_cost_produced)

Bases: tuple

average_produced

Alias for field number 3

daily_cost_produced

Alias for field number 6

maximum

Alias for field number 0

meter_reading_low_produced

Alias for field number 4

meter_reading_produced

Alias for field number 5

produced

Alias for field number 1

solar

Alias for field number 2

class toonlib.helpers.Switch(toon_instance, name)[source]

Bases: object

Core object to implement the turning on, off or toggle

Both hue lamps and fibaro plugs have a switch component that is shared. This implements that usage.

can_toggle
current_state
device_type
device_uuid
in_switch_all_group
in_switch_schedule
is_connected
is_locked
name
status
toggle()[source]
turn_off()[source]
turn_on()[source]
zwave_index
zwave_uuid
class toonlib.helpers.ThermostatInfo(active_state, boiler_connected, burner_info, current_displayed_temperature, current_modulation_level, current_set_point, current_temperature, error_found, have_ot_boiler, next_program, next_set_point, next_state, next_time, ot_communication_error, program_state, random_configuration_id, real_set_point)

Bases: tuple

active_state

Alias for field number 0

boiler_connected

Alias for field number 1

burner_info

Alias for field number 2

current_displayed_temperature

Alias for field number 3

current_modulation_level

Alias for field number 4

current_set_point

Alias for field number 5

current_temperature

Alias for field number 6

error_found

Alias for field number 7

have_ot_boiler

Alias for field number 8

next_program

Alias for field number 9

next_set_point

Alias for field number 10

next_state

Alias for field number 11

next_time

Alias for field number 12

ot_communication_error

Alias for field number 13

program_state

Alias for field number 14

random_configuration_id

Alias for field number 15

real_set_point

Alias for field number 16

class toonlib.helpers.ThermostatState(name, id, temperature, dhw)

Bases: tuple

dhw

Alias for field number 3

id

Alias for field number 1

name

Alias for field number 0

temperature

Alias for field number 2

class toonlib.helpers.Usage(average_daily, average, daily_cost, daily_usage, is_smart, meter_reading, value)

Bases: tuple

average

Alias for field number 1

average_daily

Alias for field number 0

daily_cost

Alias for field number 2

daily_usage

Alias for field number 3

is_smart

Alias for field number 4

meter_reading

Alias for field number 5

value

Alias for field number 6

toonlib.toonlib module

A library overloading the api of the toon mobile app

class toonlib.toonlib.Toon(username, password, state_retrieval_retry=3)[source]

Bases: object

Model of the toon smart meter from eneco.

gas

return – A gas object modeled as a named tuple

get_light_by_name(name)[source]

Retrieves a light object by its name

Parameters:name – The name of the light to return
Returns:A light object
get_smartplug_by_name(name)[source]

Retrieves a smartplug object by its name

Parameters:name – The name of the smartplug to return
Returns:A smartplug object
get_thermostat_state_by_id(id_)[source]

Retrieves a thermostat state object by its id

Parameters:id – The id of the thermostat state
Returns:The thermostat state object
get_thermostat_state_by_name(name)[source]

Retrieves a thermostat state object by its assigned name

Parameters:name – The name of the thermostat state
Returns:The thermostat state object
lights

return – A list of light objects modeled as named tuples

power

return – A power object modeled as a named tuple

smartplugs

return – A list of smartplug objects.

temperature

The current actual temperature as perceived by toon.

Returns:A float of the current temperature
thermostat

The current setting of the thermostat as temperature

Returns:A float of the current setting of the temperature of the thermostat
thermostat_info

return – A thermostatinfo object modeled as a named tuple

thermostat_state

The state of the thermostat programming

Returns:A thermostat state object of the current setting
thermostat_states

return – A list of thermostatstate object modeled as named tuples

toonlib.toonlibexceptions module

Main module Exceptions file

Put your exception classes here

exception toonlib.toonlibexceptions.IncompleteResponse[source]

Bases: exceptions.Exception

Vital information is missing from the response

exception toonlib.toonlibexceptions.InvalidCredentials[source]

Bases: exceptions.Exception

The username and password combination was not accepted as valid

exception toonlib.toonlibexceptions.InvalidThermostatState[source]

Bases: exceptions.Exception

Vital information is missing from the response

exception toonlib.toonlibexceptions.UnableToGetSession[source]

Bases: exceptions.Exception

Could not refresh session

Module contents

toonlib package