Skip to main content

Our intention is to design an oriented object access to the lifepo4wered-pi3 data module during runtime application.

Project description

Lifepo4weredPyController
========================

.. image:: https://travis-ci.org/fredericklussier/Lifepo4weredPyController.svg?branch=master
:target: https://travis-ci.org/fredericklussier/Lifepo4weredPyController

.. image:: https://coveralls.io/repos/github/fredericklussier/Lifepo4weredPyController/badge.svg?branch=master
:target: https://coveralls.io/github/fredericklussier/Lifepo4weredPyController?branch=master

.. image:: https://api.codeclimate.com/v1/badges/809cf25fc925a3ed8ef2/maintainability
:target: https://codeclimate.com/github/fredericklussier/Lifepo4weredPyController/maintainability
:alt: Maintainability

.. image:: https://badge.fury.io/py/lifepo4weredPyController.svg
:target: https://badge.fury.io/py/lifepo4weredPyController


Our intention is to design an oriented object access to the lifepo4wered-pi3 data module during runtime application.

reference: http://lifepo4wered.com/lifepo4wered-pi3.html

Using the Raspbery Pi zero in many projects, I found this product
very usefull. So to help my child and python colleagues, we design this.

You can find here the documentation of the lifepo4wered product:
http://lifepo4wered.com/files/LiFePO4wered-Pi3-Product-Brief.pdf.

Status
------
In development

Installation
------------
If you want to use this wrapper, you need:

Not yet, but we will have one, soon.

To dowload and install the LiFePO4wered-Pi drivers and CLI applications,
please read https://github.com/xorbit/LiFePO4wered-Pi.

Features (working on)
---------------------
* Oriented object definition
* Observable elements, so subscribed observers will know when data change
* Periodically read data,
* Python 3.5 and 3.6
* Hardly tested

Detail:
^^^^^^

classes
"""""""
The idea is to use oriented object mechanism to control the LiFePO4wered-Pi variables.
We have distributated LiFePO4wered-Pi variables in different classes:

* Battery (VBAT)
* Led (LED_STATE)
* Touch (TOUCH_STATE)
* WakeTimer (WAKE_TIME)
* USBPowerSource (VIN)

**What about others variables?**
Well! must of them, we just not there yet.
But we think that some of variables are factoring issue (not to use in a runtime environment)
and the provided CLI works perfectly for them.
Like:

* I2C_REG_VER
* I2C_ADDRESS
* DCO_RSEL
* DCO_DCOMOD
* CFG_WRITE


basic usage
*****************

.. code-block:: python

import time
import lifepo4weredPyController

@lifepo4weredPyController.battery.observeElement("rate")
def printRate(previous, actual):
print("previously:{0}, now:{1}".format(previous, actual))

try:
print(lifepo4weredPyController.battery.voltage)

# keep main process alive, so observers will receive changes
while True:
time.sleep(0.1)

except KeyboardInterrupt:
myLifepo4wered.ceaseReading()
print('stopped!')

lifepo4weredPyController.wakeUp = 60 # boot in 1 hour after shutdown

Legendary
*********
* **properies:** name of class property
* **aka:** name used by the LiFePO4wered-Pi variables
* **access:** provide the access of the data of the variable. read means it reads the data from LiFePO4wered and write means it writes value to LiFePO4wered.
* **Periodicaly read:** at interval, this data is read so observers will be notified of any changes
* **na:** not applicable


+-------------------------------------------------------------------------------+
| **Battery** |
+-------------------------------+-----------+------------+----------------------+
| **properies** | **aka** | **access** | **Periodicaly read** |
+===============================+===========+============+======================+
| voltage | VBAT | read only | True |
+-------------------------------+-----------+------------+----------------------+
| rate' | na | read only | True |
+-------------------------------+-----------+------------+----------------------+

'rate: Will give the battery pourcentage


+-------------------------------------------------------------------------------+
| **USBPowerSource** |
+===============================+===========+============+======================+
| **properies** | **aka** | **access** | **Periodicaly read** |
+-------------------------------+-----------+------------+----------------------+
| voltage | VIN | read only | True |
+-------------------------------+-----------+------------+----------------------+
| pluggedIn' | na | read only | True |
+-------------------------------+-----------+------------+----------------------+

'pluggedIn: Will mention is the usb connector is plug to a power source


+-------------------------------------------------------------------------------+
| **Led** |
+-------------------------------+-----------+------------+----------------------+
| **properies** | **aka** | **access** | **Periodicaly read** |
+===============================+===========+============+======================+
| state | LED_STATE | read/write | True |
+-------------+-----------------+-----------+------------+----------------------+
| **methods** | |
+-------------+-----------------------------------------------------------------+
| on | set on the led |
+-------------+-----------------------------------------------------------------+
| off | set off the led |
+-------------+-----------------------------------------------------------------+
| pulse | led pulsing |
+-------------+-----------------------------------------------------------------+
| flash | led flashing |
+-------------+-----------------------------------------------------------------+


+---------------------------------------------------------------------------------+
| **Touch** |
+===============================+=============+============+======================+
| **properies** | **aka** | **access** | **Periodicaly read** |
+-------------------------------+-------------+------------+----------------------+
| state | TOUCH_STATE | read only | true |
+-------------------------------+-------------+------------+----------------------+


+-------------------------------------------------------------------------------+
| **WakeTimer** |
+===============================+===========+============+======================+
| **properies** | **aka** | **access** | **Periodicaly read** |
+-------------------------------+-----------+------------+----------------------+
| wakeUp | WAKE_TIME | read/write | False |
+-------------------------------+-----------+------------+----------------------+



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

lifepo4weredPyController-0.1.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

lifepo4weredPyController-0.1.1-py2.py3-none-any.whl (10.9 kB view hashes)

Uploaded Python 2 Python 3

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