Helper to create python cloudio applications
Project description
cloudio-connector-python
This library is a helper to create python cloudio applications.
Example:
class Example(AttributeListener):
def __init__(self):
cc = CloudioConnector("https://example.com", "user", "password")
cc.add_attribute_listener(self)
attr = AttributeId(uuid=cc.get_uuid('demo'), node='myNode', objects=['myObject'], attribute='mySetPoint'),
# subscribe to attribute on change event
cc.subscribe_to_attribute(attr)
# get attribute time series
tm = TimeSeries(attr, start=datetime.now() - datetime.timedelta(hours=2), stop=datetime.now(), resample='15m')
data = cc.get_time_series(tm)
# get the last value of an attribute
last_val = cc.get_last_value(attr)
# write the value of an attribute
cc.write_value(attr, 1.0)
# this method is called when a subscribed attribute has changed
def attribute_has_changed(self, attribute: AttributeId, value):
print(str(attribute) + ' ' + str(value))
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
Close
Hashes for cloudio-connector-python-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3ff69e56bcccb4d7cc61414cabac1fa464ff4af1e3042ed0b52d3c3aebeba26 |
|
MD5 | 5c1ddae316a91c98ea3ad53e54b2c64b |
|
BLAKE2b-256 | 6e0b5600b777d7da100ddd8cd2de47c2b6d1fee7a7890e9b899335e0165759e5 |
Close
Hashes for cloudio_connector_python-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c669be0b413b254c1b7b2e9dc280b1f913926e5027389d3f7f3ff6b8babca78 |
|
MD5 | 2ef88972fda8f6610fd4c5032908a341 |
|
BLAKE2b-256 | ff09226adcddce2d8cb8a5c06a68092541a6fe7e86919e1b717487facdc611c5 |