Metadata-Version: 2.1
Name: batterytender
Version: 1.2.0
Summary: Python API for talking to the Deltran Battery Tender API
Home-page: https://github.com/jkoelker/batterytender/
Author: Jason Kölker
Author-email: jason@koelker.net
License: MIT
Keywords: deltran battery tender batterytender
Platform: UNKNOWN
Requires-Dist: requests (>=1.0.0)
Requires-Dist: ttldict
Requires-Dist: python-dateutil

===================================================
Python API for Deltran Battery Tender WiFi products
===================================================


Installation
============

.. code-block:: bash

    pip install batterytender


Usage
=====

Module
------

You can import the module as ``batterytender``.

.. code-block:: python

    import batterytender

    email = 'XXXXXXXXXXXXXXXXXXXX'
    password = 'XXXXXXXXXXXXXXXXXXXX'

    bt = batterytender.BatteryTender(email, password)

    for monitor in bt.monitors:
        print('Monitor id: {}'.format(monitor.device_id))
        print('    Name: {}'.format(monitor.name))
        print('    Date: {}'.format(monitor.date))
        print('    Voltage: {}'.format(monitor.voltage))


        # Historical readings
        print('    History:')
        for history in monitor.history:
            print('        Date: {}'.format(history['date']))
            print('        Voltage: {}'.format(history['voltage']))


        # The latest reading is also available in the same format as
        # historical reading via the `.current` property
        print('    Current:')
        print('        Date: {}'.format(monitor.current['date']))
        print('        Voltage: {}'.format(monitor.current['voltage']))


