Python3 client for Kuzzle IoT environment as described at kuzzle-iot-deploy
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)
my_device_state = {
"temperature" : 26
}
my_device.publish_state(my_device_state)
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)