Add a data point method
This method creates a new data point entry inside the DataPoints container.
data.add(stream_name, value[, units][, quality][, description][, location])
Required parameters
- stream_name: Specifies the data stream name to which this data point is added.
- value: The value to assign to this data point. Currently the only supported types are integer, float, and string.
Optional keyword parameters
- units: A string, specifying the units associated with data on this data stream. If this value is specified, it will overwrite the units field of the data stream in Digi Remote Manager. Individual data points do not have units associated with them.
- quality: A user-defined 32-bit integer value indicating the quality of the data in the data point.
- description: A string, specifying a description of the data point.
- location: A tuple of three floating point numbers, indicating the geo-location information of the data point. Geo-location is represented as (latitude in degrees, longitude in degrees, elevation in meters).
Return value
None.
If any of the parameters values are of an inappropriate type (such as an integer for stream name), a TypeError or ValueError is raised indicating the problem.
This method will raise an OSError with the error code ENOSPC when there is not enough room to add the data point to the upload buffer. The amount of space each data point consumes in the buffer varies based on the length of the string value and how many of the optional parameters are specified.
Note DataPoints objects that use the TRANSPORT_UDP transport are limited to one data point per DataPoints container.