Skip to main content

Python API for talking to the Deltran Battery Tender API

Project description

Installation

pip install batterytender

Usage

Module

You can import the module as batterytender.

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']))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

batterytender-1.0.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page