new TemperatureSensor(initOption)
Represents a Temperature Sensor.
Parameters:
| Name | Type | Description |
|---|---|---|
initOption |
Object | sensor's initialized information |
- Source:
Methods
(private, static) initTemperatureSensorInfo(self, initOption, driver)
Initialize values for the Temperature Sensor
Parameters:
| Name | Type | Description |
|---|---|---|
self |
Object | TemperatureSensor object |
initOption |
Object | Initialized option |
driver |
Object | Sensor driver |
- Source:
readData()
Read data from sensor. This function will be called at sensor's frequency.
- Source:
Fires:
unit(unit)
Set unit for temperature sensor
Parameters:
| Name | Type | Description |
|---|---|---|
unit |
String | temperature unit, should be 'c' or 'C' for Celsius, 'f' or 'F' or Fahrenheit |
- Source:
Events
onchange
onchange event.
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
newdata |
Object | Most recent changed data (compared to the threshold value) read from sensor |
- Source:
ondata
ondata event.
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
newData |
Object | Most recent data read from sensor |
- Source:
onerror
onerror event.
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
err |
Object | Indicates the error |
- Source: