Devices
Properties
| facilityID (integer) - read only |
|---|
| The facilityID property gets the unique identifier of the facility to which the device belongs |
| Examples |
| let devices = env.facility.devices; env.log(devices.facilityID) |
| count (integer) - read only |
|---|
| The count property gets the number of devices that exist in the facility |
| Examples |
| let devices = env.facility.devices; env.log(devices.count) |
Methods
| byAddress(string deviceAddress ) |
|---|
| The byAddress method returns a device object whose address matches the one specified in the deviceAddress parameter. If no device is found with the specified address, the method returns null. For more information see device |
| Examples |
| let devices = env.facility.devices; let device = devices.byAddress('1') env.log(device) |
| byIndex(integer index) |
|---|
| The byIndex method returns a device object whose index matches the one specified in the index parameter. A value of zero is equivalent to the first device. If no device is found with the specified index, the method returns null. For more information see device |
| Examples |
| let devices = env.facility.devices; let device = devices.byIndex(0) env.log(device) |
| toArray() |
|---|
| The toArray method returns an array of device objects. For more information see device |
| Examples |
| let devices = env.facility.devices; let deviceArr = devices.toArray() env.log(deviceArr) |