Skip to content

etrousset/py-kuzzle-iot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

py-kuzzle-iot

Python3 client for Kuzzle IoT environment as described at kuzzle-iot-deploy

Usage

Instantiate and connect to Kuzzle

my_device = KuzzleIOT(
    my_device_uid,
    "my-device-type",
    host=kuzzle_conf['host'],
    port=kuzzle_conf['port'],
    owner=config["device"]["owner"]
)

my_device.connect(on_kuzzle_connected_cb)

Publish device state to Kuzzle

my_device_state = {
    "temperature" : 26
}

my_device.publish_state(my_device_state)

Subscribe to device changes through Kuzzle

def on_state_change_cb(self, state, is_partial):
    # TODO: merge or replace my device state with the one from Kuzzle


my_device.subscribe_state(on_state_change_cb)

About

python client for Kuzzle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages