Skip to content

Configuration

hitch-b24 edited this page Mar 6, 2018 · 2 revisions

The picosapi module provides a service for controlling configuration within the module and your program. Currently there are only two built in configuration values, host and port, which are used when constructing Event and API URL objects. The configuration is stored as a dictionary of {"key": value} pairs inside the module.

Getting Configuration

You can retrieve configuration using the picosapi.get_config(key, default=None) function, where the key argument is the string key associated with the value you want to retrieve. The optional default argument specifies a default value to return if the key does not exist within the configuration.

Setting Configuration

You can set configuration using the picosapi.set_config(key, value) function, where the key argument is the string key associated with the value you want to update or add to the configuration. The value represents the value of configuration pair.

Picos API Documentation

A Note About Picos

Picos are useful in building Internet of Things (IoT) technology that preserves personal freedom. They are currently being developed under the direction of Dr. Phil Windley by Pico Labs at Brigham Young University. Picos is an actor-based programming system that supports people-centric, reactive programming on the Internet of Things.

For more information about Picos, visit Pico Labs or see Dr. Windley's article on Reactive Programming with Picos.

Clone this wiki locally