Skip to main content

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


Download files

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

Source Distribution

cloudio-connector-python-0.1.0.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

cloudio_connector_python-0.1.0-py3-none-any.whl (6.9 kB view hashes)

Uploaded 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