public class Sensor extends ItemProperties
Modifier and Type | Field and Description |
---|---|
static double |
invalidValue
Invalid sensor value constant
|
item
Constructor and Description |
---|
Sensor(java.util.Map<java.lang.String,java.lang.String> data,
java.lang.String propName,
Item item,
java.lang.Enum event,
java.lang.String ajaxPath) |
Modifier and Type | Method and Description |
---|---|
void |
remoteCalculateLastMessage(int[] sensors,
ResponseHandler callback)
Perform remote sensors calculation by the latest unit message
|
void |
remoteCalculateMsgs(java.lang.String source,
int indexFrom,
int indexTo,
int sensorId,
ResponseHandler callback)
Calculate sensor value
|
createProperty, deleteProperty, getProperties, getProperty, updateProperty, updateProperty
public static final double invalidValue
public Sensor(java.util.Map<java.lang.String,java.lang.String> data, java.lang.String propName, Item item, java.lang.Enum event, java.lang.String ajaxPath)
public void remoteCalculateLastMessage(int[] sensors, ResponseHandler callback)
sensors
- optional sensor indexes, pass empty array to obtain all sensorscallback
- callback, that get result likes {sens1Id: val, sens2Id: val, ...}public void remoteCalculateMsgs(java.lang.String source, int indexFrom, int indexTo, int sensorId, ResponseHandler callback)
source
- empty string for the messages loader, otherwise indexFrom
- starting index (inclusive)indexTo
- ending index (inclusive)sensorId
- pass 0 to obtain all sensorscallback
- callback, that get result in form is an array of requested sensor(s) values