Proof project by kotko


Keywords
sample, setuptools, development
License
MIT
Install
pip install toonlib==1.0.2

Documentation

DEPRECATION NOTE

This library was using the unofficial api which has been terminated since 09-01-2019 so it will no longer work. There is a new version of the library that works with the official api and can be found at https://github.com/costastf/toonapilib

toonlib

A library to interact with Eneco's toon.

Main information is cached for 30 seconds before reaching out to the api for freshness. Assigning values to either the thermostat or the thermostat state effectively changing the temperature clears the cache so the next call will get fresh info about the settings.

Most returned information is currently modeled as a named tuple since they need no intelligence. The smartplugs and lights are proper objects since they need to call the api and refresh their values. Everything else will evolve according to it's needs.

The library exposes the data that toon uses to graph its consumption both as flow data (hourly consumption for the day) and graph data (yearly, monthly, weekly, daily, hourly) consumption.

Features

  • Reads values for gas, electric, temperature.
  • Identifies connected hue lights and fibaro smartplugs
  • Can read and set temperature and thermostat state
  • Can turn lights or plugs on, off or toggle their state
  • Can get consumption values from fibaro plugs
  • More ...

TODO

  • Change the caching library to a name spaced one.
  • Fine tune the caching sanely across all required objects
  • Properly implement caching for flow and graph data information