Hygrometer Component


Properties

available
  Specifies whether or not the device has the hardware to support the Hygrometer component.
Data type: boolean
Designer Writable false
Code Writeable false
Code Readable true let variable = hygrometerName.available

enabled
  Specifies whether the sensor should generate events. If true, the sensor will generate events. Otherwise, no events are generated.
Data type: boolean
Designer Writable true <hygrometer name="hygrometerName" enabled="true">
Code Writeable true hygrometerName.enabled = true
Code Readable true let variable = hygrometerName.enabled

humidity
  Returns the relative ambient humidity as a percentage. The sensor must be enabled and available to return meaningful values.
Data type: number
Designer Writable false
Code Writeable false
Code Readable true let variable = hygrometerName.humidity

refreshTime
  The requested minimum time in milliseconds between changes in readings being reported. Android is not guaranteed to honor the request. Setting this property has no effect on pre-Gingerbread devices.
Data type: number
Designer Writable true <hygrometer name="hygrometerName" refreshTime="1000">
Code Writeable true hygrometerName.refreshTime = 1000
Code Readable true let variable = hygrometerName.refreshTime

class
  The styling class of the the component
Data type: string
Designer Writable true <hygrometer name="hygrometerName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <hygrometer name="hygrometerName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <hygrometer name="hygrometerName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
humidityChanged Indicates the relative humidity changed.
hygrometerName.addEventListener(
    "humidityChanged",
    function (humidity) {
        //Your code here
    }
)
humidity number