Skip to content

Latest commit

 

History

History
86 lines (46 loc) · 1.58 KB

senml_record.md

File metadata and controls

86 lines (46 loc) · 1.58 KB

senml_record Module

senml_record.SenmlRecord Objects

represents a single value in a senml pack object

enter

__enter__(self)

for supporting the 'with' statement

returns: self

exit

__exit__(self, exc_type, exc_val, exc_tb)

when destroyed in a 'with' statement, make certain that the item is removed from the parent list.

returns: None

init

__init__(self, name, **kwargs)

create a new senml record

parameters:

  • kwargs: optional parameters:
    • value: the value to store in the record
    • time: the timestamp to use (when was the value measured)
    • name: the name of hte record
    • unit: unit value
    • sum: sum value
    • update_time: max time before sensor will provide an updated reading
    • callback: a callback function taht will be called when actuator data has been found. Expects no params

do_actuate

do_actuate(self, raw, naming_map)

called when a raw senml record was found for this object. Stores the data and if there is a callback, calls it.

parameters:

  • raw: raw senml object

returns: None

sum

time

get the time at which the measurement for the record was taken.

returns: a unix time stamp. This is the absolute value, not adjusted to the base time of the pack.

update_time

get the time at which the next measurement is expected to be taken for this record.

returns: a unix time stamp. This is the absolute value, not adjusted to the base time of the pack.

value

get the value currently assigned to the object