Simple Wappsto Python user-interface to Wappsto IoT
Project description
Wappsto IoT
The wappstoiot module provide a simple python interface to wappsto.com for easy prototyping.
Prerequisites
A wappsto.com Account, that the unit can connect to.
The wappsto module requires a set of certificates for authentication. The certificates can be downloaded from wappsto.com, or with the build-in CLI tool: python3 -m wappstoiot
.
The certificates provides the unit with the secure connection to wappsto.com.
To read more about how the Wappsto IoT work behind the screen go here.
The Basics
To understand how to use Wappsto IoT, there is some terms that need to be known.
- Control
- Change request value.
- Report
- The current value.
- Refresh
- Value Update request.
- Delete
- inform that a delete have happened.
- network -> device -> value
- ...
Getting Started
Working examples of usage can be found in the example folder.
Echo example
The following explains the example code found in info.py.
network = wappstoiot.Network(
name="echo",
configFolder="echo"
)
device = network.createDevice(
name="EchoDevice"
)
value = device.createValue(
name="Moeller",
value_type=wappstoiot.ValueType.STRING
)
value.onControl(
callback=lambda obj, new_value: obj.report(new_value)
)
value.onRefresh(
callback=lambda obj: obj.report(f"{obj.data} Refreshed!")
)
try:
while True:
time.sleep(0.5)
except KeyboardInterrupt:
pass
finally:
network.close()
Installation using pip
The wappsto module can be installed using PIP (Python Package Index) as follows:
$ pip install -U wappstoiot
License
This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details.
v0.5.3 (Dec 9, 2021)
Added
- Groove Examples for Raspberry Pi.
- Checks of naming, so it reuses the object based on the name. (Naming are mandatory now.)
wappstoiot.config
have been added to handle all the configs.wappstoiot.createNetwork
have been added to streamline the flow.value.getReportTimestamp()
,value.getControlTimestamp()
have been added to make the timestamp for the last given value accessible.value.getControlData()
have been added to make the control data accessible.
Removed
- Remove the Module ids. (The Names are now the unique identifier.)
- Remove
Rich
dependency.
Changed
- The names & naming convention to fix the other Wappsto Libraries.
- All the connections & general configs are moved from the Network, to wappstoiot.
value.data
have been changed tovalue.getReportData()
Fixed
- Fix the naming to fit the naming convention.
v0.5.2 (Nov 25, 2021)
Added
- HTTP Proxy support. (Pulls #259, #353)
Fixed
- Make WappstoIoT python3.6 compatible.
- Fix a Path issue that make the code not able to find the certificates in ipython.
v0.5.1 (Nov 23, 2021)
Added
- Pip release.
Fixed
- Fix the name to fit the naming convention.
v0.5.0 (September 20, 2021)
Added
- First Release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wappstoiot-0.5.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 554c823440559027bf089d048c3eff3463e0f60cb2458ef576a0b328f523183c |
|
MD5 | fea82134f37e3af6aefce3b2c48dd722 |
|
BLAKE2b-256 | d633bdb51eb14346fdeda824ccd0366b3cb287e3187fe227482dcc02a227e852 |